Skip to main content
You are currently viewing the documentation for Filament 3.x, which is a previous version of Filament.Looking for the current stable version? Visit the 5.x documentation.

Overview

Filament includes a prebuilt action that is able to replicate Eloquent records. You may use it like so:
If you want to replicate table rows, you can use the Filament\Tables\Actions\ReplicateAction instead:

Excluding attributes

The excludeAttributes() method is used to instruct the action which columns should be excluded from replication:

Customizing data before filling the form

You may wish to modify the data from a record before it is filled into the form. To do this, you may use the mutateRecordDataUsing() method to modify the $data array, and return the modified version before it is filled into the form:

Redirecting after replication

You may set up a custom redirect when the form is submitted using the successRedirectUrl() method:
If you want to redirect using the replica, use the $replica parameter:

Customizing the replicate notification

When the record is successfully replicated, a notification is dispatched to the user, which indicates the success of their action. To customize the title of this notification, use the successNotificationTitle() method:
You may customize the entire notification using the successNotification() method:

Lifecycle hooks

Hooks may be used to execute code at various points within the action’s lifecycle, like before the replica is saved.

Halting the replication process

At any time, you may call $action->halt() from inside a lifecycle hook, which will halt the entire replication process:
If you’d like the action modal to close too, you can completely cancel() the action instead of halting it: