Create table action that redirect to a new CreateRecord page
Hi! I'm wondering if it's possible to create table actions that open a create record page, prefilled with data from a selected record. I managed to do it for the edit page, but not for creating a new one. Im getting this error: Target [Illuminate\Database\Eloquent\Model] is not instantiable. ->actions([
Tables\Actions\Action::make('R1')
->label('R1')
->icon('heroicon-o-arrow-path')
->tooltip(__('Rectificativa R1'))
->color('warning')
->url(fn($record) => route('filament.client.resources.invoices.verifactu-r1', [
'record_id' => $record->id,
]))
->visible(fn($record) => in_array($record->status, ['pending', 'revision']))
->openUrlInNewTab(false),
Solution:Jump to solution
filment has Replicate action check this https://filamentphp.com/docs/3.x/actions/prebuilt-actions/replicate
4 Replies
what actually are you trying to achieve
to recreate the same record ??
Yes, I want to make something like an edit page, but instead of editing, it should create a new record with some of the modified data.
Solution
filment has Replicate action check this https://filamentphp.com/docs/3.x/actions/prebuilt-actions/replicate
oh awesome! thanks!