update commands

This commit is contained in:
Andras Bacsai 2023-10-03 12:08:57 +02:00
parent 75862ca8de
commit 194675c838
2 changed files with 16 additions and 4 deletions

View File

@ -10,14 +10,14 @@
use function Laravel\Prompts\confirm;
use function Laravel\Prompts\select;
class ResourceDelete extends Command
class ResourcesDelete extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'resource:delete';
protected $signature = 'resources:delete';
/**
* The console command description.
@ -46,6 +46,10 @@ public function handle()
private function deleteApplication()
{
$applications = Application::all();
if ($applications->count() === 0) {
$this->error('There are no applications to delete.');
return;
}
$application = select(
'What application do you want to delete?',
$applications->pluck('name')->toArray(),
@ -60,6 +64,10 @@ private function deleteApplication()
private function deleteDatabase()
{
$databases = StandalonePostgresql::all();
if ($databases->count() === 0) {
$this->error('There are no databases to delete.');
return;
}
$database = select(
'What database do you want to delete?',
$databases->pluck('name')->toArray(),
@ -74,6 +82,10 @@ private function deleteDatabase()
private function deleteService()
{
$services = Service::all();
if ($services->count() === 0) {
$this->error('There are no services to delete.');
return;
}
$service = select(
'What service do you want to delete?',
$services->pluck('name')->toArray(),

View File

@ -8,14 +8,14 @@
use function Laravel\Prompts\password;
class ResetRootPassword extends Command
class UsersResetRoot extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'app:reset-root-password';
protected $signature = 'users:reset-root';
/**
* The console command description.