The Create Page
The Create page displays a form for creating new records. When you generate a resource, Filament creates aCreateCustomer.php page class:
packages/panels/src/Resources/Pages/CreateRecord.php
Form Definition
The create form is defined in your resource’sform() method. This is typically referenced from a separate schema file:
Validation
Validation is handled automatically through field rules:beforeCreate() hook.
Lifecycle Hooks
Hooks allow you to execute code at specific points in the creation process:packages/panels/src/Resources/Pages/CreateRecord.php
- Adding User ID
- Sending Email
- Logging Activity
Mutating Data
Modify form data before saving:packages/panels/src/Resources/Pages/CreateRecord.php
Customizing Creation Process
Override how records are created:packages/panels/src/Resources/Pages/CreateRecord.php
Redirects After Creation
By default, users are redirected to the Edit page (or View page if it exists).Redirect to List Page
Redirect to View Page
Redirect to Previous Page
Global Redirect Configuration
Set a default redirect for all resources:Success Notifications
Customize the success notification:packages/panels/src/Resources/Pages/CreateRecord.php
Create Another
The “Create & create another” button allows users to create multiple records quickly.Disabling Create Another
Preserving Form Data
Keep some fields filled when creating another record:packages/panels/src/Resources/Pages/CreateRecord.php
Halting Creation
Stop the creation process at any point:Wizards
Transform the create page into a multi-step wizard:Custom Actions
Add custom buttons to the form:Header Actions
Form Actions
Moving Create to Header
Authorization
Users can access the Create page if thecreate() method of the model policy returns true: