F
Filament3mo ago
kabu

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),
4 Replies
yalax
yalax3mo ago
what actually are you trying to achieve to recreate the same record ??
kabu
kabuOP3mo ago
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.
kabu
kabuOP3mo ago
oh awesome! thanks!

Did you find this page helpful?