Skip to content

Commit

Permalink
Add confirmation to delete
Browse files Browse the repository at this point in the history
  • Loading branch information
notAreYouScared committed Nov 22, 2024
1 parent ff2d059 commit 4592fde
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/Filament/Resources/ServerResource/Pages/EditServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,11 @@ public function form(Form $form): Form
->authorize(fn (Server $server) => auth()->user()->can('delete database'))
->color('danger')
->icon('tabler-trash')
->requiresConfirmation()
->modalIcon('tabler-database-x')
->modalHeading('Delete Database?')
->modalSubmitActionLabel(fn (Get $get) => 'Delete ' . $get('database') . '?')
->modalDescription(fn (Get $get) => 'Are you sure you want to delete ' . $get('database') . '?')
->action(function (DatabaseManagementService $databaseManagementService, $record) {
$databaseManagementService->delete($record);
$this->fillForm();
Expand Down

0 comments on commit 4592fde

Please sign in to comment.