prowler
Is it possible to manage different resources (models) on each Step inside a Wizard?
on the last step it creates another new rfq and being redirected to its edit page with no assembly(ies) attached to it. how can i prevent the submit on the last step, or at least control it more granularly?
16 replies
Is it possible to manage different resources (models) on each Step inside a Wizard?
i managed to solve it with some public variables on the
CreateRfq
itself which then I pass between each step and attaching this relationship on the step's afterValidation()
function, for example -
16 replies
Is it possible to manage different resources (models) on each Step inside a Wizard?
Assembly.php
-
Rfq.php
Basically, on the second step there should be some sort of a repeater for the assemblies while each of them should automatically derive the rfq's id that was created on the first step so eventually i won't have this field visible to the user since the rfq was already 'chosen' on the previous step -
Assembly.php
- getForm()
function -
Thanks again @awcodes for your time. It's not taken for granted!16 replies
Is it possible to manage different resources (models) on each Step inside a Wizard?
And on the assembly form there's a select field with a relationship to rfq -
(the reason i didn't use
->relationship('rfq','name')
because it tries to load this relationship on the rfq create page and obviously its wrong because rfq doesn't have a relationship called rfq as well)
I hoped I could somehow patch it by creating a real rfq on the first step -
And then pass this rfq's id to the next step like this -
But sadly it doesn't work and because both forms share some attributes with the same name (e.g. name
) then when moving to step 2 it basically derives the name of the rfq from step 1 because the wizard sees all these forms as one big form and not as separate ones.
Hope i was clear and provided enough info16 replies
Is it possible to manage different resources (models) on each Step inside a Wizard?
sadly i can't share the whole repo so i'll paste some crucial pieces to understand the overall concept -
I have a resource called RfqResource and its create page with a wizard and these are the steps -
each of these
getBomFormSchema()
functions basically returns an array with the whole scheme, for example -16 replies
Is it possible to manage different resources (models) on each Step inside a Wizard?
@awcodes - when searching for 'wizard' here in discord i saw that you wrote to someone -
You’re trying to use the wizard as a multiple form instead of steps in a form so it going to require a more granular custom approach.
. Do you mind sharing any direction for that? Im struggling to manage a wizard with 3 steps where each step should handle a different form for a different resource, but still no success.16 replies
Filament is saving relationship only on edit (update) pages but not on create.
ok, i spotted something interesting.. not sure if its a bug in filament/livewire or just a bad architecture by myself.
my whole $form has a disabled function attached to it conditionally in this way -
Once the form is disabled - all its relationships aren't being saved. Once I remove this disabled condition - it all works just fine.
5 replies