F
Filament15mo ago
Stevee

Add custom js to specific panel

I have more than 1 panel and I want to add custom js to specific panel, there is way to add it at https://filamentphp.com/docs/3.x/support/assets#registering-javascript-files , but it will load on all panel. so wondering is there method can use to add custom js at panel provider
1 Reply
Patrick Boivin
Patrick Boivin15mo ago
Your panel has a bootUsing() method. I think you can register the assets in that method:
return $panel
// ...
->bootUsing(function ($panel) {
FilamentAsset::register(...);
})
return $panel
// ...
->bootUsing(function ($panel) {
FilamentAsset::register(...);
})
Want results from more Discord servers?
Add your server