Adding Submit-Button via getFormSchema
Hey - Maybe I am too tired, but right now I struggle on creating a simple form on a Page.
So far I got this:
What I want is to create a simple search-form with 2 parameters where there is a button below the Text-Inputs which then submits the form, but as soon as I try to add
Action::make()
PHP comes down on me.
I am sure I can do what I want somehow within the getFormSchema()-method, but I don't see how. I want the button specificly below the Textinputs and NOT on the top right where the Page-Actions would normally reside. What am I missing here?
(@pboivin)8 Replies
Is it a custom page?
https://filamentphp.com/docs/2.x/forms/getting-started#preparing-your-livewire-component
Filament
Getting started - Form Builder - Filament
The elegant TALL stack form builder for Laravel artisans.
Yes and no. It was made via
php artisan make:filament-page
which already includes the Forms-Interface and -Trait. So again this more about "how the flying f do it get this inside the schema?"did you add in the view file?
Yep - I did, but that has two sideeffects:
1.) It places the button outside the Section...
2.) When I click on the button - i get the following error:
Unable to set component data. Public property [$parameter_one] not found on component
.
My Page-Class looks like this:
Great! That fixes the error - but on the button -> guess I will have to make another view... right?
And yes - I promise not to code anymore today... (We got a saying here: What comes after beeing tired? Beeing stupid. And I am post-tired as hell... 😄 )
If you want to add the submit button inside the Section, you can use ViewField:
Thank you!