how to use livewire componet as a custom modalContent
I’m using a Livewire component as the content of a Filament modal (modalContent).
Specifically, I’m embedding the Livewire component inside a Blade view, and then passing that view to modalContent().
The problem is: when I click the form submit button inside my Livewire component, it does not trigger the create method in the Livewire component class.
Instead, the submission gets intercepted by the Filament modal’s action handler (the ->action() method defined on the modal).
8 Replies
Why not rendering a form in a modal?
https://filamentphp.com/docs/4.x/actions/modals/#rendering-a-form-in-a-modal
You are correct, but I also need to display additional content besides the form. For example, when a user selects a product from the select input, I want to display the product details on the left side
Check the docs you can render a custom view in the modal content.
@siraj I have the same problem, have you solved it? I need livewire component inside blade, but that component has multiple forms, or infolists
You can just render a Livewire components inside a blade view.
Hi. I did rendered Livewire component inside blade view. Also I added HasSchema interface to Livewire component and added form with submit action. But when I submit form in Livewire component, Action modal (Filament) is closed.
Maybe open a new thread and provide some code
I see you already did
Yes, I will post code now. Here is thread: https://discord.com/channels/883083792112300104/1418903064450044006