How to Install Bootstrap 4 in Laravel 7/6 Tutorial and Example

Bookmark

In this tutorial, we'll see how to install Bootstrap 4 in our Laravel 7/6 application by example.

Bookmark This Article

Your browser doesn't support automatic bookmarking. You can:

  1. Press Ctrl+D (or Command+D on Mac) to bookmark this page
  2. Or drag this link to your bookmarks bar:
Bookmark This

Clicking this bookmarklet when on any page of our site will bookmark the current page.

How to Install Bootstrap in Laravel 7?

We simply need to install the laravel/ui package using Composer and installing the Bootstrap 4 package from npm.

The laravel/ui package provides the scaffoldings for bootstrap, vue and react. And the auth scaffold for login and registration.

Installing Bootstrap

Head over to your terminal, navigate to your Laravel 7 project and run the following command:

$ composer require laravel/ui

After successfully installing the package, we install Bootstrap 4 in our application using the following command:

$ php artisan ui bootstrap

You can also install the auth scaffoldings using the following command instead:

$ php artisan ui bootstrap --auth

Finally, you need to install the bootstrap package and the related frontend dependencies such as jquery from npm using the following command:

$ npm install