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:
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/overview
Jump to solution
4 Replies
Excavator
ExcavatorOP2mo ago
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
Dennis Koch
Dennis Koch2mo ago
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/overview
Excavator
ExcavatorOP2mo ago
but 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
Dennis Koch
Dennis Koch2mo ago
Yep. Make sure you check the v4 docs though 😅

Did you find this page helpful?