vito/app/Traits/HasProjectThroughServer.php
Saeed Vaziry f6bc04763b
2.x
2024-09-27 20:36:03 +02:00

23 lines
416 B
PHP

<?php
namespace App\Traits;
use App\Models\Project;
use App\Models\Server;
use Illuminate\Database\Eloquent\Relations\HasOneThrough;
trait HasProjectThroughServer
{
public function project(): HasOneThrough
{
return $this->hasOneThrough(
Project::class,
Server::class,
'id',
'id',
'server_id',
'project_id'
);
}
}