Matt Jenkins
Matt Jenkins
FFilament
Created by Matt Jenkins on 12/15/2023 in #❓┊help
Component not firing events in some render hooks
I have the following render hook set up in the boot method in: app/Providers/Filament/AdminPanelProvider.php
FilamentView::registerRenderHook(
'panels::global-search.before',
fn (): string => Blade::render('@livewire(\'publish-staff-button\')'),
);
FilamentView::registerRenderHook(
'panels::global-search.before',
fn (): string => Blade::render('@livewire(\'publish-staff-button\')'),
);
This renders a simple component in: resources/views/livewire/publish-staff-button.blade.php
<x-filament::button wire:click="$dispatch('publish-staff')">
Publish
</x-filament::button>
<x-filament::button wire:click="$dispatch('publish-staff')">
Publish
</x-filament::button>
With the following method in the component class: app/Livewire/PublishStaffButton.php
#[On('publish-staff')]
public function publishStaff(): void
{
// Do something...
}
#[On('publish-staff')]
public function publishStaff(): void
{
// Do something...
}
Now if the render hook is in 'panels::global-search.start' then it will work but messes up the global search results (no idea why) but if it is in 'global-search.before' no events are fired. Any ideas?
5 replies
FFilament
Created by Matt Jenkins on 11/29/2023 in #❓┊help
Show form actions at the top
How can you move the form action buttons to the top of the page (next to the delete button) on a resources create and edit pages?
2 replies
FFilament
Created by Matt Jenkins on 10/6/2023 in #❓┊help
Refresh a table when notification received
Is there any way to refresh a table when a broadcast notification is received?
5 replies