An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
command: delete server
Andras Bacsai5a7b16ea5fec
diff --git a/app/Console/Commands/ResourcesDelete.php b/app/Console/Commands/ResourcesDelete.phpindex c9ad0f0e92..2b71cee89d 100644--- a/app/Console/Commands/ResourcesDelete.php+++ b/app/Console/Commands/ResourcesDelete.php@@ -3,6 +3,7 @@namespace App\Console\Commands;use App\Models\Application;+use App\Models\Server;use App\Models\Service;use App\Models\StandalonePostgresql;use Illuminate\Console\Command;@@ -34,7 +35,7 @@ class ResourcesDelete extends Command{$resource = select('What resource do you want to delete?',- ['Application', 'Database', 'Service'],+ ['Application', 'Database', 'Service', 'Server'],);if ($resource === 'Application') {$this->deleteApplication();@@ -42,6 +43,27 @@ class ResourcesDelete extends Command$this->deleteDatabase();} elseif ($resource === 'Service') {$this->deleteService();+ } elseif($resource === 'Server') {+ $this->deleteServer();+ }+ }+ private function deleteServer() {+ $servers = Server::all();+ if ($servers->count() === 0) {+ $this->error('There are no applications to delete.');+ return;+ }+ $serversToDelete = multiselect(+ 'What server do you want to delete?',+ $servers->pluck('id')->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();+ $toDelete->delete();}}private function deleteApplication()