#Hiding Create form buttons untill the last step of a Wizard
1 messages · Page 1 of 1 (latest)
IF you define the submit action on the moal it is the last one:
->submitAction(! $submitButton ? false : new HtmlString(Blade::render('<x-forms::button type="submit">Submit</x-forms::button>'))),
if you are using a resource, you should use the HasWizard trait
https://filamentphp.com/docs/3.x/panels/resources/creating-records#using-a-wizard
I am defining the wizard on the form function on the main resource, with that trait how can i check how many steps it has? or do i have to create the getSteps function on the createresouce class?
getSteps to the pages, CreatePage, EditPage..
Well thats so much easier, i was handling all the data with If clauses to check if it was even there when saving, it just saves so many lines of code. I thought of using the steps function but i would never have noticed I was missing that trait, thank you so much! I marked your answer as solution but im going to write a small text explaining the whole process and mark that so its easier to understand when searching!
Basically, if you need to hide the form buttons, you can use the HasWizard trait (https://filamentphp.com/docs/3.x/panels/resources/creating-records#using-a-wizard props @craggy aurora) and then create the getSteps function in your record handler class (Create/EditPage). This function returns the steps your wizard has to the form and uses the handleRecordCreation/Update method, if you have overriden it, it uses your logic, or else it uses the default, to display a button on the last step of the wizard to create or save the changes you made to the record. In the end, you don't need to do anything to hide the buttons, as i thought, you just need to let filament handle the form for you with the getSteps function!
Thank you for marking this question as solved!
@craggy aurora im sorry to bother again, but is there any way i can change the next button text to "seguinte" on the wizard when implementing it with the getSteps method? I ve looked into the docs but found nothing
translate it: php artisan vendor:publish --tag=filament-forms-translations
please open new topics if you have other questions