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);



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'),
        );


And my blade:
<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
Was this page helpful?