Using a Wizard inside a relationManager?
Hi, I'm trying to use a form wizard inside the form method but not sure if that can be done ?
Solution:Jump to solution
So my first thought would be to try using the
Wizard
as a layout component, inside of your working form:
https://filamentphp.com/docs/3.x/forms/layout/wizard...45 Replies
Can you share your code?
had to remove the Wizard code because it wasn't working at all
so, the form that pops up in the modal, it's going to be growing, that's why I need wizard...
added this code to the table function but it's not working either
and now I'm getting this error when opens the modal
It's missing the doctor id somehow.
Sorry it's hard to help with screenshots. If you could share the code as text.
but only happens when trying to implement the wizard
without wizzard works just fine
this is the whole code
Ok I see a
steps()
method with the Wizard, but I don't see how it's used in the formCrazy thought, try naming your action to something other than ‘create’
And Patrick is right, where’s the doctor_id in your wizard?
so, that wizard is just the example posted in the fillament page
That’s what’s not clear to me how to use it 😐
Just to make sure I understand: What is your final goal? Do you want to organize the form fields with a Wizard, inside of the Create action of the relation manager?
Correct
And what's the current version of your code? I see above you have a custom header action where you're calling
->steps()
, and then the code you shared for the relation manager, which has both a form()
and a steps()
method. What is working for you at this point?it only works the form method (commented code) bc I haven't been able to make the wizzard work in that relation manager
Ok, so you have a version of the Create action with a regular form, that saves correctly?
yes, works perfect... I wanted to add the wizard becase the content it's too large and it's gonna be working with steps
Ok, sounds good.
Solution
So my first thought would be to try using the
Wizard
as a layout component, inside of your working form:
https://filamentphp.com/docs/3.x/forms/layout/wizardDoes that make sense?
that worked
Very nice
Just a thought - You can also remove the modal actions at the bottom and add a submit button on the last step of the Wizard, to make sure users have to go through all the steps:
awesome, thank you so much my man!
it doesn't hide the footer buttons
->headerActions([
Tables\Actions\CreateAction::make()->modalFooterActions(fn () => null),
])
or
->headerActions([
Tables\Actions\CreateAction::make()->modalFooterActions(fn () => []),
])
I alos use ->modalSubmitAction(false)
Hmm... not sure, this one works for me
fn () => []
you add that code un the CreateAction::make() ?
it's a relation manager view?
I'll do one more test
Yes, just like that on the relation manager table:
exactly like I have the code..it's weird
Try this:
Does it work on a custom action?
yes, it works in a custom action
Mkay, I really don't know at this point 😅
oh
I know
just passed the name of the method to the CreateAction:make and that makes it work LOL
->headerActions([
Tables\Actions\CreateAction::make('form')
->modalFooterActions(fn () => []),
])
Oooh! Nice, good to know.
Very weird... but if it works it works 😁
LOL
thanks!
How to make each step submit button in filament wizard so that I can save two table data from one wizard.
to save in two different tables you have to use ->relationship()
Its actually one to one relationship. So first time its create with related table and later always update
LIke Creating customer & later will create customer profile & finally always update profile.