Skip to main content

The Edit Page

The Edit page displays a form for modifying existing records. It’s defined in EditCustomer.php:
packages/panels/src/Resources/Pages/EditRecord.php

Form Prefilling

When the page loads, the form is automatically filled with the record’s data. The mount() method handles this:
packages/panels/src/Resources/Pages/EditRecord.php

Customizing Data Before Fill

Modify data before it’s loaded into the form:

Lifecycle Hooks

Execute code at specific points during editing:
packages/panels/src/Resources/Pages/EditRecord.php

Mutating Data Before Save

Modify form data before it’s saved:
packages/panels/src/Resources/Pages/EditRecord.php
This runs after validation but before beforeSave().

Customizing the Saving Process

Override how records are updated:
packages/panels/src/Resources/Pages/EditRecord.php
For custom update logic:

Redirects After Save

By default, users stay on the Edit page after saving.

Redirect to List Page

Redirect to View Page

Stay on Page

Global Configuration

Success Notifications

Customize the success notification:
packages/panels/src/Resources/Pages/EditRecord.php
Full customization:
Disable notifications:

Saving Form Sections Independently

Allow users to save individual form sections:

Halting the Save Process

Stop saving at any point:

Refreshing Form Data

Refresh specific fields from the database:
packages/panels/src/Resources/Pages/EditRecord.php
Useful after background jobs update records:

Header Actions

Add actions to the page header:

Custom Form Actions

Add buttons below the form:

Moving Save to Header

Multiple Edit Pages

Create additional Edit pages for complex resources:
1

Generate the page

2

Register it

3

Define its form

Authorization

Users can access the Edit page if the update() method of the model policy returns true:
They can also delete the record if delete() returns true:

Database Transactions

Edit pages automatically wrap saves in database transactions. This is controlled by the CanUseDatabaseTransactions trait. To disable transactions:

Unsaved Changes Alert

The HasUnsavedDataChangesAlert trait warns users when they try to leave with unsaved changes. This is enabled by default.