Replicate action
Overview
Filament includes a prebuilt action that is able to replicate Eloquent records. You may use it like so:
use Filament\Actions\ReplicateAction;
ReplicateAction::make()
->record($this->post)
If you want to replicate table rows, you can use the Filament\Tables\Actions\ReplicateAction
instead:
use Filament\Tables\Actions\ReplicateAction;
use Filament\Tables\Table;
public function table(Table $table): Table
{
return $table
->actions([
ReplicateAction::make(),
// ...
]);
}
Excluding attributes
The excludeAttributes()
method is used to instruct the action which columns should be excluded from replication:
ReplicateAction::make()
->excludeAttributes(['slug'])