Skip to main content

Delete Actions

Filament provides multiple ways to delete records:
  • Single delete - Delete button on Edit/View pages
  • Bulk delete - Select multiple records and delete them at once
  • Table row delete - Delete action in table rows

Deleting from Edit/View Pages

Add a delete action to the page header:

Deleting from the List Page

Delete individual records from the table:

Bulk Delete

Bulk delete is available by default through toolbar actions:

Soft Deletes

Laravel’s soft delete functionality allows “deleting” records without actually removing them from the database.

Creating a Resource with Soft Deletes

This generates a resource with:
  • Force delete actions
  • Restore actions
  • Trashed filter

Adding Soft Deletes to Existing Resources

1

Update the table

2

Update Edit page

Soft Delete Actions

Soft deletes the record:
The record can still be restored.

Trashed Filter

The trashed filter allows users to view:
  • Active records only (default)
  • Trashed records only
  • All records (active and trashed)

Authorization

Filament observes model policy methods for delete operations:

Single Delete

Bulk Delete

Filament uses deleteAny() for bulk operations because checking delete() for each record is not performant.

Check Individual Records in Bulk Delete

To check the delete() policy for each record:
This may cause performance issues with large selections.

Force Delete Authorization

Restore Authorization

Customizing Delete Actions

Confirmation Modal

Customize the delete confirmation:

Requiring Confirmation

Require the user to type a word:

Success Notification

Before/After Hooks

Bulk Delete Performance

By default, bulk delete loads all records into memory to:
  1. Authorize each record individually (when using authorizeIndividualRecords())
  2. Fire model events (deleting, deleted)

Chunking Records

Process records in smaller batches:

Skip Fetching Records

For maximum performance, skip loading records entirely:
This bypasses individual authorization checks and model events.

Preventing Accidental Deletion

Add extra safeguards for important data:

Lifecycle Events

Listen to model events in observers:
Register the observer: