Go to different step based on field value

Hi! I'm working on a wizard and I have to redirect the user to different steps based on the value of a specific field. Could not find anything in the docs or here. Every kind of hint will be pure gold. In the docs I found this: https://filamentphp.com/docs/3.x/forms/layout/wizard#customizing-the-wizard-action-objects and I thought it could be useful, but for now I can't figure out how.
1 Reply
Davide Cariola
Davide CariolaOP7mo ago
I managed somehow but the UX is not the best. I persisted the step in the query string and I used this:
->afterValidation(function(Get $get){
if($get('product_id') == 1){
redirect('admin/publications/create?step=linking');
}
}),
->afterValidation(function(Get $get){
if($get('product_id') == 1){
redirect('admin/publications/create?step=linking');
}
}),
but you'll see the redirecting, which is unfortunate. Maybe someone has some ideas to start from here and make it smoother?
Want results from more Discord servers?
Add your server