addMonth(1), function () { return Reseller::with(['location', 'provider', 'price', 'ips', 'labels', 'labels.label'])->get(); }); } public static function resellerHosting(string $shared_id) {//Single reseller hosting and relationships (no using joins) return Cache::remember("reseller_hosting.$shared_id", now()->addMonth(1), function () use ($shared_id) { return Reseller::where('id', $shared_id) ->with(['location', 'provider', 'price', 'ips', 'labels', 'labels.label'])->get(); }); } public function ips() { return $this->hasMany(IPs::class, 'service_id', 'id'); } public function location() { return $this->hasOne(Locations::class, 'id', 'location_id'); } public function provider() { return $this->hasOne(Providers::class, 'id', 'provider_id'); } public function price() { return $this->hasOne(Pricing::class, 'service_id', 'id'); } public function labels() { return $this->hasMany(LabelsAssigned::class, 'service_id', 'id'); } }