Introduction
Filament includes several prebuilt actions that simplify common Eloquent operations. These actions come with sensible defaults, automatic authorization, notifications, and full customization options.Available prebuilt actions
The following actions are available out of the box:- CreateAction - Create new records with a form
- EditAction - Edit existing records
- ViewAction - View records in read-only mode
- DeleteAction - Delete records with confirmation
- ReplicateAction - Duplicate existing records
- ForceDeleteAction - Permanently delete soft-deleted records
- RestoreAction - Restore soft-deleted records
- ImportAction - Import data from files
- ExportAction - Export data to files
Create action
The create action opens a modal with a form to create new Eloquent records:Creating another record
The create action includes a “Create & create another” button by default:Edit action
The edit action opens a modal with a form pre-filled with the record’s data:Delete action
The delete action requires confirmation before deleting records:Bulk delete action
Allow users to delete multiple records at once:Optimizing bulk deletes
For large datasets, use chunking to reduce memory usage:When using
fetchSelectedRecords(false), model events and individual record authorization are skipped.View action
The view action displays record data in read-only form fields:Replicate action
The replicate action duplicates existing records:Lifecycle hooks
Execute code at different points in the replication process:Soft delete actions
Filament provides specialized actions for Laravel’s soft delete feature:Force delete action
Permanently delete soft-deleted records:Restore action
Restore soft-deleted records:Bulk actions
Both actions have bulk variants:Customizing notifications
All prebuilt actions dispatch success notifications that you can customize:Redirecting after actions
Customize where users are redirected after an action completes:Lifecycle hooks
All prebuilt actions support lifecycle hooks for executing code at specific points:Halting execution
Stop an action from completing usinghalt() or cancel():
cancel() to close the modal: