Serve forms from controller
I'm building a process where creating an order will need to serve multiple forms in stages and then save the data each time along with the step number so they can go back to the order. Depending on choices different forms will be served.
In ordinary PHP I would have a controller to do the selection of forms and data processing.
Can I somehow do that but serve filament forms instead of normal html forms and return the data after completion?
Thanks a lot
Mike
Solution:Jump to solution
So you add the form to a component, depending on the step will depend on the schema it loads in, the schema could be array return functions within the component.
8 Replies
Yeah of course, just do the forms in an array schema and return them accordingly. Rememebr forms are build of 'array' of Input Classes
Thanks @toeknee
How do I access the form data in a controller as I'm only used to Filament doing it all by itself
Questiomn.. why use a controller and not a dynamic livewire page?
Lack of knowledge 🙂
So don't do it then hehe and skill up!
I would tend to recommend a livewire page/class for the form, this livewire form can the be called in any blade.
Solution
So you add the form to a component, depending on the step will depend on the schema it loads in, the schema could be array return functions within the component.
Thanks @toeknee. I appreciate the pointers.