fillForm on Create Page?
I've created a duplicate action as below:
Now, while this works alright for a simple resource (pop-up forms), it doesn't fill the form in case of regular resource (individual create / edit pages).
What should I do differently for it to work for regular resource?
Now, while this works alright for a simple resource (pop-up forms), it doesn't fill the form in case of regular resource (individual create / edit pages).
What should I do differently for it to work for regular resource?
Solution
- Yea my bad. I was just adopting code from previous messages. You would indeed need to abstract your form fields and reuse them both in your resource and in the replicas form. For example:
Also see: https://filamentphp.com/docs/3.x/panels/resources/creating-records#sharing-fields-between-the-resource-form-and-wizards
Then you could use
- I suppose that is related to 1 because
form(fn (Form $form) => static::form($form->model(static::$model))->columns(2))seems rather unconventional. Not sure where you got that from