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

  • Author: Ahmed Bouchefra

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

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 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

Sponsored Links