Resources/js/app.js and css/app.css not working
Not sure what I'm missing here, but any CSS or JS I add to these files are not having any effect.
I've tried npm run build and restarting my web server but it's as though those files are just getting completely ignored.
I've also tried artisan cache:clear and artisan view:clear
Any help/suggestions appreciated. Thanks.
Solution:Jump to solution
For the css you’ll want to use a custom theme. The js is a little more complicated but have a look https://filamentphp.com/docs/3.x/support/assets on how you can include assets with the asset manager.
6 Replies
Are you using panels? Because app.js and app.css are not loaded on panels by default.
Ah right, good to know - thanks. Yes, I'm just using the default panel.
Sorry if I missed that in the docs. Is it easy to add them?
Solution
For the css you’ll want to use a custom theme. The js is a little more complicated but have a look https://filamentphp.com/docs/3.x/support/assets on how you can include assets with the asset manager.
You also don’t have to use a custom theme, but it will simplify that part of it to use one.
Right, I'll take a good read of that. I assumed just editing those files would work as it did in v2.
Thanks very much for the help.
(Although I may have had to manually register those.. I can't remember)
If you are using ngnix remove css|js| from
location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf|map)$