diff --git a/app/Console/Commands/ResourcesDelete.php b/app/Console/Commands/ResourcesDelete.php index 3b0134f47..1c90f8e6b 100644 --- a/app/Console/Commands/ResourcesDelete.php +++ b/app/Console/Commands/ResourcesDelete.php @@ -43,23 +43,24 @@ public function handle() $this->deleteDatabase(); } elseif ($resource === 'Service') { $this->deleteService(); - } elseif($resource === 'Server') { + } elseif ($resource === 'Server') { $this->deleteServer(); } } - private function 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')->sort()->toArray(), + label: 'What server do you want to delete?', + options: $servers->pluck('name', 'id')->sortKeys(), ); - foreach ($serversToDelete as $id) { - $toDelete = Server::find($id); + 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) { @@ -77,11 +78,12 @@ private function deleteApplication() } $applicationsToDelete = multiselect( 'What application do you want to delete?', - $applications->pluck('name')->sort()->toArray(), + $applications->pluck('name', 'id')->sortKeys(), ); foreach ($applicationsToDelete as $application) { - $toDelete = $applications->where('name', $application)->first(); + ray($application); + $toDelete = $applications->where('id', $application)->first(); $this->info($toDelete); $confirmed = confirm("Are you sure you want to delete all selected resources? "); if (!$confirmed) { @@ -99,11 +101,11 @@ private function deleteDatabase() } $databasesToDelete = multiselect( 'What database do you want to delete?', - $databases->pluck('name')->sort()->toArray(), + $databases->pluck('name', 'id')->sortKeys(), ); foreach ($databasesToDelete as $database) { - $toDelete = $databases->where('name', $database)->first(); + $toDelete = $databases->where('id', $database)->first(); $this->info($toDelete); $confirmed = confirm("Are you sure you want to delete all selected resources?"); if (!$confirmed) { @@ -111,7 +113,6 @@ private function deleteDatabase() } $toDelete->delete(); } - } private function deleteService() { @@ -122,11 +123,11 @@ private function deleteService() } $servicesToDelete = multiselect( 'What service do you want to delete?', - $services->pluck('name')->sort()->toArray(), + $services->pluck('name', 'id')->sortKeys(), ); foreach ($servicesToDelete as $service) { - $toDelete = $services->where('name', $service)->first(); + $toDelete = $services->where('id', $service)->first(); $this->info($toDelete); $confirmed = confirm("Are you sure you want to delete all selected resources?"); if (!$confirmed) { diff --git a/config/sentry.php b/config/sentry.php index b1e4266f8..7a6e8e5d2 100644 --- a/config/sentry.php +++ b/config/sentry.php @@ -7,7 +7,7 @@ // The release version of your application // Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')) - 'release' => '4.0.0-beta.81', + 'release' => '4.0.0-beta.82', // When left empty or `null` the Laravel environment will be used 'environment' => config('app.env'), diff --git a/config/version.php b/config/version.php index a85ede531..7e5447038 100644 --- a/config/version.php +++ b/config/version.php @@ -1,3 +1,3 @@