Opening a modal in a custom page
Hey, just before I make a separate thread - want to ask if it's even possible.
I have a Filament page, that renders a custom view (using the x-filament-panels etc. components).
Inside that component, I list some of my models - I can generate a link, just by passing e.g. 'link' => route('filament.admin.resources.services.view', ['record' => $service->id]),
to it and it works. Can I somehow force this view page to open in a modal? Is something like this possible?
Solution:Jump to solution
The
open-modal approach is great, if you just want to use the modals and keep everything in JS. You can also use our actions if you want to keep everything in PHP: https://filamentphp.com/docs/4.x/actions/overview4 Replies
The minute I posted this I figured it out - just had to dispatch the open-modal action, I think that's what you meant :). and it works perfectly.
@Dennis Koch sorry for the ping - mind sharing what you meant by the action in #👹┊offtopic-no-help ? Doesn't hurt to know other alternatives, even though this one works 🙂
Solution
The
open-modal approach is great, if you just want to use the modals and keep everything in JS. You can also use our actions if you want to keep everything in PHP: https://filamentphp.com/docs/4.x/actions/overviewbut can I use your actions, if I render a custom blade view for a page?
ah, probably something like this will work
https://filamentphp.com/docs/3.x/actions/adding-an-action-to-a-livewire-component
Yep.
Make sure you check the v4 docs though 😅