Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Include Bootstrap in Laravel

Tags:

I'm a Laravel newbie. I have just installed some 3rd party packages and I would like to integrate Twitter bootstrap into my script. Is there any way to do it, short of going into each package and adding the code to the blade templates of each view?

like image 320
user1801060 Avatar asked Mar 11 '14 14:03

user1801060


1 Answers

Update for Laravel 7.*

Within terminal:

laravel new project

cd project

composer require laravel/ui

php artisan ui bootstrap

npm install && npm run dev


Then, in the HTML that you are working on, pull in both the CSS and JavaScript:

<!doctype html>
<html lang="en">
  <head>
    ...
    <link href="/css/app.css" rel="stylesheet">
  </head>
  <body>
    ....
    <script src="/js/app.js"></script>
  </body>
</html>

  • Documentation for Laravel UI

@Svyat, hopefully, this answers your question as well.

Happy coding :)


I realize that this is old... but it was the top result that come up for me on Google. Hopefully this will help someone in the future.

If you are using Laravel 6.2,

Within terminal:

npm install bootstrap

Within app.scss:

@import "node_modules/bootstrap/scss/bootstrap";

In Terminal, run the following to generate /public/css/app.css file:

npm run dev 

Within welcome.blade.php:

<link rel="stylesheet" href="/css/app.css">

Happy coding

like image 108
Brad Ahrens Avatar answered Sep 22 '22 03:09

Brad Ahrens