getHeaderActions with custom header view
I'm using a custom header view, but it seems to be overwriting what's defined in my getHeaderActions method on my class. I've tried doing something like
{{ $this->headerActions }}
in my custom header blade view, but that doesn't seem to do it. How can I have a custom header AND header actions?Solution:Jump to solution
Possibly:
```
<x-filament::actions
:actions="$this->getCachedHeaderActions()”
/>...
4 Replies
or even better, can I pass the actions to the view in the getHeader method somehow?
Doing this:
I can do this:
Which is heading in the right direction, but not sure how to actually render the action on the page..
Ah! it looks like just
{{ $action }}
will do it..
but it's not handling things correctly...I have 2 actions, only one of which will be visible, and all that is defined on my class. Once they're rendered it's just displaying all of them regardless.
It looks like the button that shouldn't be visible is disabled at least, but it's still visible.Solution
Possibly:
See
https://github.com/filamentphp/filament/blob/3.x/packages/panels/resources/views/components/header/index.blade.php
And
https://github.com/filamentphp/filament/blob/3.x/packages/panels/resources/views/components/page/index.blade.php
GitHub
filament/packages/panels/resources/views/components/header/index.bl...
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS. - filamentphp/filament
GitHub
filament/packages/panels/resources/views/components/page/index.blad...
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS. - filamentphp/filament
ok, yep that fixed it, thanks!