addMonth(1), function () use ($service_id) { return self::where('service_id', $service_id)->with(['server', 'shared', 'reseller', 'domain', 'dns', 'ip'])->first(); }); } public static function allNotes() { return Cache::remember("all_notes", now()->addMonth(1), function () { return self::with(['server', 'shared', 'reseller', 'domain', 'dns', 'ip'])->orderBy('created_at', 'desc')->get(); }); } public function server(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Server::class, 'service_id', 'id'); } public function shared(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Shared::class, 'service_id', 'id'); } public function reseller(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Reseller::class, 'service_id', 'id'); } public function domain(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Domains::class, 'service_id', 'id'); } public function dns(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(DNS::class, 'service_id', 'id'); } public function ip(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(IPs::class, 'service_id', 'id'); } }