fix: improve scheduled task adding/removing

This commit is contained in:
Andras Bacsai
2024-05-14 15:19:28 +02:00
parent f06065337c
commit 317dc10af4
12 changed files with 123 additions and 56 deletions

View File

@@ -677,6 +677,17 @@ class Service extends BaseModel
{
return $this->belongsTo(Server::class);
}
public function byUuid(string $uuid) {
$app = $this->applications()->whereUuid($uuid)->first();
if ($app) {
return $app;
}
$db = $this->databases()->whereUuid($uuid)->first();
if ($db) {
return $db;
}
return null;
}
public function byName(string $name)
{
$app = $this->applications()->whereName($name)->first();