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

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

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

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