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

ibanks's avatar

My Laravel 5.1.16 Didn't Come With Twitter Bootstrap

Hello everyone. I'm a newbie to Laravel. I've been learning it through the docs and laracast vids. One of the vids suggested that I should have Twitter bootstrap installed already. I'm looking at my "resources->assets->sass->app.scss" file and I see a commented out import statement referencing a directory (node_modules/bootstrap-sass/assets/stylesheets/bootstrap) that does not exist in my Laravel installation.

What do I need to do to get Twitter bootstrap imported into my Laravel installation? Thanks for any reply.

0 likes
14 replies
rokkan's avatar

You need gulp to pull in dependencies. Run 'npm install'. Watch the videos from the beginning

rokkan's avatar

If you get an error with npm install, make sure you have node.js installed globally. Also you can run it sudo

rokkan's avatar

Agreed with @jlrdw , if youre doing something internal then bootstrap is good to get you going. If you're creating something more external recommend you look into other front-end frameworks. You dont want you're website looking like a cookie cutter site so you will need to do your own css eventually. For learning bootstrap is a good start point

ibanks's avatar

Thanks guys for the rapid replies.

I'm imagining that if I already had node.js installed with gulp prior to me installing Laravel 5 through composer, then twitter bootstrap would already have been included.

Thanks again

ovvessem's avatar

Do not forget to uncomment the bootstrap require in the default app.scss you can find in /resources/assets/css/app.scss.

rokkan's avatar

@ibanks

The laravel installation comes with a package.json file. This file has the dependencies in it (gulp/laravel-elixer/bootstrap-sass). To pull in these dependencies you need to do npm install, this will install all 3.

Laravel doesnt come with composer or node, you must install those yourself. No imagining required

ibanks's avatar

@rokkan

Okay. I see those dependencies. So that means that all I'd need to install is gulp then. Correct? The less I need to install on the server, the better. My boss grills me on installing things on our server.

rokkan's avatar

@ibanks Bootstrap is completely optional, its just a css framework. If you're going to use your own css then you dont need it.

Currently Elixer in laravel is being used but you can just comment it out in the gulp file if you dont want to use it. I personally dont use elixer or bootstrap.

rokkan's avatar

@ibanks You dont... I have a whole laravel project working without it. Its just css....

ibanks's avatar

@rokkan Okay. Understood. I'll look further into getting node.js and gulp installed. If it proves to be too much trouble, then I'll seek another option. Thanks again!

Snapey's avatar
Snapey
Best Answer
Level 122

Using gulp is entirely optional. Just include the css file (from a cdn if you like) in your master layout file.

Start off with the simple. You can always switch it out once you have it working, and you want to start to improve your CSS.

ibanks's avatar

@rokkan & Snapey

Thanks again guys. I needed to first understand what Node.js and Gulp.js was to see if I needed it or not because the Laravel forms video I looked at said twitter bootstrap was automatically included. Then it just went into using it without explaining how it was included. So I'm thinking okay "If I don't have it, why?", "what is node_modules?", "where is it", ..etc. So you both are right that I don't need any of those things to use twitter bootstrap throughout the Laravel app. I understand how. Thanks!

Please or to participate in this conversation.