"Create another" and prefill field
When creating a new record in the panel and clicking on the "create & create another" button, is there a way to reuse some of the values of the current fields for the new "new form"?
For example, I have the following fields
- name (string)
- category_id (Select with relationship)
- country_id (Select with relationship)
When a user now types/selects:
- name: XYZ
- category_id: 1
- country_id: 4711
and clicks on the "create & create another" button, the entry is saved and he is redirected to a new and empty "Create" form. I want that the new "Create" form is now prefilled with
- category_id: 1
- country_id: 4711
Possible?
3 Replies
I'm on the same boat, did you figure it out?
https://filamentphp.com/docs/3.x/actions/prebuilt-actions/create#lifecycle-hooks
Just shooting in the dark, but maybe this would work
passing in $data as variable and returning $data with certain fields being null
maybe that would pass into the new instance of the form
im new to filament too haha but maybe