Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

grozavule's avatar

Bootstrap JS isn't being included

None of the JS functions of the Bootstrap components of my application are working. (Bootstrap CSS works fine). I assume that all of Bootstrap's dependencies haven't been properly included.

I ran php artisan ui bootstrap and npm install && npm run dev. I included public/css/app.css and public/js/app.js in the HTML of my base layout. What else am I missing?

Also, by running these commands, FontAwesome has disappeared from my app.css file. Why would it have been affected?

0 likes
4 replies
PaulMaxOS's avatar

Which version of Laravel are you using? I guess you need to import bootstrap in your app.js so mix can compile it for you. Or you're importing it directly in your layout files from the bootstrap CDN.

grozavule's avatar

I'm running Laravel 8.30.1. The CSS for Bootstrap is included through the public/css/app.css file (I can search for Bootstrap classes, and they appear in the file). I'm not sure why the Bootstrap JS isn't working as well.

grozavule's avatar

Could you tell me which file(s) are responsible for importing new packages into public/js/app.js?

PaulMaxOS's avatar

Have a look at an app.js file in your resources folder. From their you can bundle other js file into you app.js file. You could also tell your mix.config file to place bootstrap.js in your public/js folder. Or you simply import bootstrap.js from their CDN in your blade layout file.

Please or to participate in this conversation.