© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•12mo ago•
30 replies
Akimbo

Can't add scripts to admin panel service provider

I tried adding the scripts as indicated here, but it doesn't appear on any part of the filament admin app.

For context, I am on a Laravel 11 app that uses Volt. But the file is still just a JS file sitting in that resources folder.

https://filamentphp.com/docs/3.x/support/assets#registering-javascript-files

class AdminPanelProvider extends PanelProvider
{
    public function boot(): void
    {
        FilamentAsset::register([
            Js::make('app', __DIR__ . '/../../../resources/js/app.js'),
        ]);
    }
class AdminPanelProvider extends PanelProvider
{
    public function boot(): void
    {
        FilamentAsset::register([
            Js::make('app', __DIR__ . '/../../../resources/js/app.js'),
        ]);
    }
Solution
Looks like using
asset()
asset()
is the proper way to do this to prevent copying the files.

class AdminPanelProvider extends PanelProvider
{
    public function boot(): void
    {
        FilamentAsset::register([
            Js::make('app-main', asset('build/app.js')),
            Css::make('custom', asset('build/custom.css')),
        ]);
    }
class AdminPanelProvider extends PanelProvider
{
    public function boot(): void
    {
        FilamentAsset::register([
            Js::make('app-main', asset('build/app.js')),
            Css::make('custom', asset('build/custom.css')),
        ]);
    }
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Admin Panel
FilamentFFilament / ❓┊help
2y ago
can’t make user yo my admin panel
FilamentFFilament / ❓┊help
3y ago
Add Selector On Admin Panel's Navbar
FilamentFFilament / ❓┊help
2y ago
I cannot access route inside panel service provider
FilamentFFilament / ❓┊help
3y ago