I disabled `inject_assets` in livewire config, how to load it manually for filament

I disabled inject_assets in livewire config, how to load it manually for filament
Solution:
I think you can inject it via panel provider instead of rendering hooks: ```php return $panel ->bootUsing(function () {...
Jump to solution
2 Replies
Saifallak
SaifallakOP4w ago
i added
FilamentView::registerRenderHook(\Filament\View\PanelsRenderHook::STYLES_BEFORE, fn (): string => Blade::render("@livewireStyles"));
FilamentView::registerRenderHook(\Filament\View\PanelsRenderHook::SCRIPTS_AFTER, fn (): string => Blade::render("@livewireScriptConfig"));
FilamentView::registerRenderHook(\Filament\View\PanelsRenderHook::BODY_END, fn (): string => Blade::render("@vite('resources/js/app.js')"));

FilamentView::registerRenderHook(\Filament\View\PanelsRenderHook::STYLES_BEFORE, fn (): string => Blade::render("@livewireStyles"));
FilamentView::registerRenderHook(\Filament\View\PanelsRenderHook::SCRIPTS_AFTER, fn (): string => Blade::render("@livewireScriptConfig"));
FilamentView::registerRenderHook(\Filament\View\PanelsRenderHook::BODY_END, fn (): string => Blade::render("@vite('resources/js/app.js')"));

is this correct?
Solution
LeandroFerreira
I think you can inject it via panel provider instead of rendering hooks:
return $panel
->bootUsing(function () {
\Livewire\Livewire::forceAssetInjection();
})
...
return $panel
->bootUsing(function () {
\Livewire\Livewire::forceAssetInjection();
})
...
Want results from more Discord servers?
Add your server