mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-28 09:14:44 +02:00
Update EditDatabaseHost.php
This commit is contained in:
parent
f6ef76d98e
commit
f6899301fd
@ -3,6 +3,7 @@
|
||||
namespace App\Filament\Resources\DatabaseHostResource\Pages;
|
||||
|
||||
use App\Filament\Resources\DatabaseHostResource;
|
||||
use App\Models\DatabaseHost;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
use Filament\Forms;
|
||||
@ -71,7 +72,9 @@ class EditDatabaseHost extends EditRecord
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\DeleteAction::make(),
|
||||
Actions\DeleteAction::make()
|
||||
->label(fn (DatabaseHost $dbh) => $dbh->databases()->count() > 0 ? 'Database Host Has Databases' : 'Delete'),
|
||||
->disabled(fn (DatabaseHost $dbh) => $dbh->databases()->count() > 0),
|
||||
$this->getSaveFormAction()->formId('form'),
|
||||
];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user