Create & create another - reuse fields
When clicking the "Create & create another" button is there a way to reuse some of the input fields? (Have some chosen inputs default to the previous value that was just saved) I have a massive number of fields and many of them could benefit by retaining the same info.
7 Replies
Maybe there's a better option, but if you extend
CreateAction
in your project, you could customize the behavior around the call to $form->fill()
:
https://github.com/filamentphp/filament/blob/2.x/packages/admin/src/Pages/Actions/CreateAction.php#L61Forgive my naiveté but how does one extend
CreateAction
? It's a core class. I don't see anything in the docs. thanksNo worries! I think there are a few ways to do it but I would probably create a class in my project, something like
App\Filament\Pages\Actions\CreateAction
Okay I'll try this
Oh wow, yes. I think my solution would only work for a Simple resource (create in modal)...
Cool, got it working. For future travelers:
In my Create Page
In my form (resource)
Is there any fix for the pre-filled image when using "Create another". I saw some chatter way. back near v.1 that it was fixed...but it doesn't look fixed. When I use "create another" button (v2) the image with fileupload is still there when it should not be.