Including livewire.js when livewire.inject_assets = false

Hi all! We're looking at integrating Filament v3 into an existing Laravel app that's already using Livewire v3. As part of that, we have inject_assets = false in our livewire config file, and the Livewire JS is instead bundled as part of our front-end build process. This is presenting a problem for Filament as the livewire.js file isn't be included on Filament pages. Has anyone else encountered this? Any good solutions?
2 Replies
gbuckingham89
gbuckingham897mo ago
We're considering doing a check in our AppServiceProvider to see if we're in a Filament panel and dynamically change the config value, i.e. if(Filament::getCurrentPanel()) { Config::set('livewire.inject_assets', true); } But wondering if there is a more elegant solution?
zoltan
zoltan6mo ago
Thanks for this one! It might not be the most elegant, but it works.