mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-28 09:14:44 +02:00
Add deletion button
This commit is contained in:
parent
9add408b6b
commit
18cbaf7458
@ -3,6 +3,8 @@
|
||||
namespace App\Filament\Resources\ServerResource\Pages;
|
||||
|
||||
use App\Filament\Resources\ServerResource;
|
||||
use App\Models\Server;
|
||||
use App\Services\Servers\ServerDeletionService;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
@ -13,7 +15,11 @@ class EditServer extends EditRecord
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\DeleteAction::make(),
|
||||
Actions\Action::make('Delete')
|
||||
->successRedirectUrl($this->getResource()::getUrl('index'))
|
||||
->color('danger')
|
||||
->action(fn (Server $server) => resolve(ServerDeletionService::class)->handle($server))
|
||||
->requiresConfirmation(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user