mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-19 18:01:37 +00:00
26 lines
485 B
PHP
26 lines
485 B
PHP
<?php
|
|
|
|
namespace App\Traits;
|
|
|
|
use App\Models\Project;
|
|
use App\Models\Server;
|
|
use Illuminate\Database\Eloquent\Relations\HasOneThrough;
|
|
|
|
trait HasProjectThroughServer
|
|
{
|
|
/**
|
|
* @return HasOneThrough<Project, Server, $this>
|
|
*/
|
|
public function project(): HasOneThrough
|
|
{
|
|
return $this->hasOneThrough(
|
|
Project::class,
|
|
Server::class,
|
|
'id',
|
|
'id',
|
|
'server_id',
|
|
'project_id'
|
|
);
|
|
}
|
|
}
|