© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
1 reply
thiktak

How to add modal button action in renderHook ?

Hello,

I am creating a bookmarks system, and I need to add an Action icon on the toolbar. For that, I found the hook(panels::global-search.after).
Everything is fine until I click on the button. On a filament page it's woking and the modal (or slideOver) is opening. BUT when I click on the toolbar button ... nothing (I receive a close-modal event).
I was in the wrong ? Any idea ?

ServiceProvider: registererd component
Livewire::component('topbar-bookmark', \Thiktak\FilamentBookmarks\Livewire\TopbarBookmark::class);
Livewire::component('topbar-bookmark', \Thiktak\FilamentBookmarks\Livewire\TopbarBookmark::class);



Created a middleware (also tested in the packageBooted):
        FilamentView::registerRenderHook(
            'panels::global-search.after',
            fn (): string => Blade::render('@livewire(\Thiktak\FilamentBookmarks\Livewire\TopbarBookmark::class)') //, [\'lazy\' => true])')
            //fn (): View => view('thiktak-filament-bookmarks::components.topbar.index'),
        );
        FilamentView::registerRenderHook(
            'panels::global-search.after',
            fn (): string => Blade::render('@livewire(\Thiktak\FilamentBookmarks\Livewire\TopbarBookmark::class)') //, [\'lazy\' => true])')
            //fn (): View => view('thiktak-filament-bookmarks::components.topbar.index'),
        );


And my blade:
<div>
    {{ $this->bookmarkAction }}

    <x-filament-actions::modals /> <!-- With or without :( -->
</div>
<div>
    {{ $this->bookmarkAction }}

    <x-filament-actions::modals /> <!-- With or without :( -->
</div>


For the Livewire component, nothing big : bookmarkAction() : BookmarkAction::make('topbar'), with InteractsWithActions a InteractsWithForms.

The event seems different: I have a close-modal instead of a open-modal 😦

I followed https://filamentphp.com/docs/3.x/actions/adding-an-action-to-a-livewire-component
image.png
Adding an action to a Livewire component - Actions - Filament
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

ADD a Action Button in Modal
FilamentFFilament / ❓┊help
3y ago
Add modal to custom action button without action called
FilamentFFilament / ❓┊help
3y ago
Returning Action in renderHook
FilamentFFilament / ❓┊help
8mo ago
How to add custom action button on edit modal form
FilamentFFilament / ❓┊help
15mo ago