magic search bar

This commit is contained in:
Andras Bacsai
2023-05-11 15:20:02 +02:00
parent 8e1c6d2bd2
commit 70d032ff23
17 changed files with 686 additions and 481 deletions

View File

@@ -28,6 +28,7 @@ class Server extends BaseModel
'extra_attributes' => SchemalessAttributes::class,
];
public function standaloneDockers()
{
return $this->hasMany(StandaloneDocker::class);
@@ -57,4 +58,11 @@ class Server extends BaseModel
{
return Server::where('team_id', session('currentTeam')->id)->whereRelation('settings', 'is_validated', true)->get();
}
static public function destinations($server_uuid)
{
$server = Server::where('team_id', session('currentTeam')->id)->where('uuid', $server_uuid)->firstOrFail();
$standaloneDocker = collect($server->standaloneDockers->all());
$swarmDocker = collect($server->swarmDockers->all());
return $standaloneDocker->concat($swarmDocker);
}
}