F
Filament5mo ago
ericmp

Is A Persistent Audio Player in Filament Admin Panel Possible?

im trying to add a persistent livewire player component in the filament admin footer. Just with this sentence is enough so u can tell if what im trying to do is possible?
6 Replies
ericmp
ericmpOP5mo ago
maybe i would have to create the app again using just livewire without the admin panel and for the tables and for the forms, use filament but all outside the admin panel not sure
bogus
bogus5mo ago
use Render hooks to include any code anywhere in the panel ї https://filamentphp.com/docs/3.x/support/render-hooks
Dennis Koch
Dennis Koch5mo ago
Inject the element via render hooks and use @persists: https://livewire.laravel.com/docs/navigate#persisting-elements-across-page-visits
Laravel
Navigate | Laravel
A full-stack framework for Laravel that takes the pain out of building dynamic UIs.
ericmp
ericmpOP5mo ago
trying it right now! ty 🙏 should i use ->spa() in the admin panel provider? or it has nothing to do with it?
Dennis Koch
Dennis Koch5mo ago
Ah, it seems this is a feature that related to wire:navigate. So I think it needs at least ->spa(). Not sure whether it works with Filament though. Sorry.
ericmp
ericmpOP5mo ago
im trying it with spa yeah. hmm at the moment im doing some progress, its kinda persisting it, but when i wanna go to play next song is persisting the one that is being played and not playing the next one. im debuggin it further now ^^ for the render hook, u think this way is ok?
->renderHook(
PanelsRenderHook::FOOTER,
function (): string {
$alias = str(PersistentPlayer::class)->classBasename()->kebab();
return Blade::render("@livewire(\"{$alias}\")");
},
)
->renderHook(
PanelsRenderHook::FOOTER,
function (): string {
$alias = str(PersistentPlayer::class)->classBasename()->kebab();
return Blade::render("@livewire(\"{$alias}\")");
},
)
i feel it kinda hacky idk

Did you find this page helpful?