© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
4 replies
Vp

How to return array in renderhook

I have renderhook I register like below in panel, and it's working
->renderHook(
    'panels::head.start', fn (): View => view('abc'),
)
->renderHook(
    'panels::global-search.before', fn (): string => Blade::render('@livewire(\'abc\')'),
)
->renderHook(
    'panels::global-search.after', fn (): View => view('xyz'),
)
->renderHook(
    'panels::head.start', fn (): View => view('abc'),
)
->renderHook(
    'panels::global-search.before', fn (): string => Blade::render('@livewire(\'abc\')'),
)
->renderHook(
    'panels::global-search.after', fn (): View => view('xyz'),
)

But it look kind of repeat, I can see that
->renderHook
->renderHook
accept array, but I cannot make it working. How can I convert all my renderhook inside one
->renderHook()
->renderHook()


Note: Now I only post 3, but in actual I have around 7 of them
Solution
the hook name is always string, the array is for scopes
so if these hooks for different areas you need to repeat it
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How to access scoped resource data in RenderHook?
FilamentFFilament / ❓┊help
4mo ago
How to add modal button action in renderHook ?
FilamentFFilament / ❓┊help
3y ago
Returning Action in renderHook
FilamentFFilament / ❓┊help
8mo ago
return string instead array
FilamentFFilament / ❓┊help
2y ago