belongsTo(Customer::class); } public function server() { return $this->belongsTo(DnsServer::class, 'dns_manager_server_id'); } public static function forHosting($hosting): ?self { return static::query() ->where('customer_id', $hosting->customer_id) ->where('dns_manager_server_id', $hosting->dns_manager_server_id) ->first(); } }