addMonth(1), function () { return Domains::with(['provider', 'price', 'labels', 'labels.label'])->get(); }); } public static function domain(string $domain_id) {//Single domains and relationships (no using joins) return Cache::remember("domain.$domain_id", now()->addMonth(1), function () use ($domain_id) { return Domains::where('id', $domain_id) ->with(['provider', 'price', 'labels', 'labels.label'])->get(); }); } 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'); } }