Gustavo
Can't create custom page with multiple forms
I'm creating a custom page and so far it has been working correctly, but now I found a problem that doesn't make any sense to me.
This custom page has two forms in it. Following the documentation about adding forms to livewire components: https://filamentphp.com/docs/3.x/forms/adding-a-form-to-a-livewire-component#using-multiple-forms
I implemented the
HasForms
interface and used the InteractsWithForms
on the custom page class
I initialized both forms data as an empty array
I defined a getForms()
function returning an array with both forms names
I defined both functions that define each form
And lastly I filled both forms on the mount()
function
After all this, somehow when I open the page, I get the error App\Filament\Pages\Kanban::formHours(): Argument #1 ($form) must be of type Filament\Forms\Form, Filament\Infolists\Infolist given
which happens when filament tries to run the form definition function.
Did I do something wrong? Why isn't it working? Since the page class is implementing the HasForms
interface and the InteractsWithForms
trait, why is Filament trying to feed an Infolist to the form definition function?5 replies
Dinamically control content of <x-filament::modal>
Hey everyone, I have a custom page that loads A LOT of models and for each of these models there's a
<x-filament::modal
with details about that specific model.
Since it's a high number of models, this page is becoming incredibly slow, I was given the task to optmize it. I thought about the idea of having only one modal on the page and dinamically change the contents inside it before opening after I click one of the models Open modal
button.
The problem is: I couldn't find a documentation page talking about doing this. My knowledge about livewire, while not zero, isn't great. Can someone point to a docs page of an article where this is done (if one exists) so I can get a better grasp about this idea?
Thanks4 replies