How to install Bootstrap 4 in Laravel 8

In this tutorial you will learn about the How to install Bootstrap 4 in Laravel 8 and its application with practical example.

How to install Bootstrap 4 in Laravel 8

In this article, you will learn you how to install bootstrap 4 in laravel 8, I’ll show you how install bootstrap 4 in laravel 8. In this step by step laravel 8 install bootstrap 4 tutorial. you will understand to install bootstrap 4 in laravel 8.

Install Laravel Project

Install Laravel/UI

Now, switch the laravel project directory and run the following composer command to install laravel/ui package. Laravel UI is an official library that offers selective or predefined UI components. The laravel/ui package comes with the login and registration scaffolding for React, Vue, jQuery, and Bootstrap layouts.

Run the following composer command to install Laravel/UI.

Install Bootstrap 4 In laravel 8

Run following artisan command to install Bootstrap in your Laravel project.

Install Bootstrap Auth Scaffolding

Use the following artisan command to Install the auth scaffoldings with Bootstrap.

Now, you have successfully installed bootstrap in your laravel 8 project, you can see your resource directory js folder.

Install Bootstrap Packages

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

Run NPM

Now, run the below command for asset compilation.

The above command compiles CSS and JavaScript files from resources/js and resources/sass folder to the public folder.

How to use Bootstrap in Laravel Blade Template

Now, you can use the bootstrap js and CSS in laravel blade template as following:

In this tutorial we have learn about the How to install Bootstrap 4 in Laravel 8 and its application with practical example. I hope you will like this tutorial.