fix: delete event to deleting

This commit is contained in:
Andras Bacsai 2023-10-05 08:46:26 +02:00
parent 1c8f92d3b7
commit 91db1953ff
3 changed files with 3 additions and 3 deletions

View File

@ -22,7 +22,7 @@ class Project extends BaseModel
'project_id' => $project->id, 'project_id' => $project->id,
]); ]);
}); });
static::deleted(function ($project) { static::deleting(function ($project) {
$project->environments()->delete(); $project->environments()->delete();
$project->settings()->delete(); $project->settings()->delete();
}); });

View File

@ -16,7 +16,7 @@ class Service extends BaseModel
protected static function booted() protected static function booted()
{ {
static::deleted(function ($service) { static::deleting(function ($service) {
$storagesToDelete = collect([]); $storagesToDelete = collect([]);
foreach ($service->applications()->get() as $application) { foreach ($service->applications()->get() as $application) {
instant_remote_process(["docker rm -f {$application->name}-{$service->uuid}"], $service->server, false); instant_remote_process(["docker rm -f {$application->name}-{$service->uuid}"], $service->server, false);

View File

@ -28,7 +28,7 @@ class StandalonePostgresql extends BaseModel
'is_readonly' => true 'is_readonly' => true
]); ]);
}); });
static::deleted(function ($database) { static::deleting(function ($database) {
// Stop Container // Stop Container
instant_remote_process( instant_remote_process(
["docker rm -f {$database->uuid}"], ["docker rm -f {$database->uuid}"],