update command

This commit is contained in:
Andras Bacsai 2023-10-11 14:12:02 +02:00
parent 5a7b16ea5f
commit 3e4538de98

View File

@ -55,14 +55,16 @@ private function deleteServer() {
}
$serversToDelete = multiselect(
'What server do you want to delete?',
$servers->pluck('id')->toArray(),
$servers->pluck('id')->sort()->toArray(),
);
$confirmed = confirm("Are you sure you want to delete all selected resources?");
if (!$confirmed) {
return;
}
foreach ($serversToDelete as $server) {
$toDelete = $servers->where('id', $server)->first();
$this->info($toDelete);
$confirmed = confirm("Are you sure you want to delete all selected resources?");
if (!$confirmed) {
break;
}
$toDelete->delete();
}
}
@ -75,14 +77,16 @@ private function deleteApplication()
}
$applicationsToDelete = multiselect(
'What application do you want to delete?',
$applications->pluck('name')->toArray(),
$applications->pluck('name')->sort()->toArray(),
);
$confirmed = confirm("Are you sure you want to delete all selected resources?");
if (!$confirmed) {
return;
}
foreach ($applicationsToDelete as $application) {
$toDelete = $applications->where('name', $application)->first();
$this->info($toDelete);
$confirmed = confirm("Are you sure you want to delete all selected resources? ");
if (!$confirmed) {
break;
}
$toDelete->delete();
}
}
@ -95,14 +99,16 @@ private function deleteDatabase()
}
$databasesToDelete = multiselect(
'What database do you want to delete?',
$databases->pluck('name')->toArray(),
$databases->pluck('name')->sort()->toArray(),
);
$confirmed = confirm("Are you sure you want to delete all selected resources?");
if (!$confirmed) {
return;
}
foreach ($databasesToDelete as $database) {
$toDelete = $databases->where('name', $database)->first();
$this->info($toDelete);
$confirmed = confirm("Are you sure you want to delete all selected resources?");
if (!$confirmed) {
return;
}
$toDelete->delete();
}
@ -116,14 +122,16 @@ private function deleteService()
}
$servicesToDelete = multiselect(
'What service do you want to delete?',
$services->pluck('name')->toArray(),
$services->pluck('name')->sort()->toArray(),
);
$confirmed = confirm("Are you sure you want to delete all selected resources?");
if (!$confirmed) {
return;
}
foreach ($servicesToDelete as $service) {
$toDelete = $services->where('name', $service)->first();
$this->info($toDelete);
$confirmed = confirm("Are you sure you want to delete all selected resources?");
if (!$confirmed) {
return;
}
$toDelete->delete();
}
}