In this tutorial you will learn about the How to Properly Install and Use Bootstrap 4 in Laravel 8 and its application with practical example.
In this How to Properly Install and Use Bootstrap 4 in Laravel 8 tutorial I will show you how to install bootstrap 4 in laravel 8. In this tutorial you will learn to install bootstrap 4 in laravel 8. In this article I will share example to install bootstrap 4 in laravel application.
How to Properly Install and Use Bootstrap 4 in Laravel 8
In this step by step laravel 8 install bootstrap 4 tutorial I will demonstrate you to install bootstrap 4 in laravel 8. We will cover the following concepts of Laravel and Bootstrap:
- How to Install Laravel/UI.
- How to install Bootstrap and its packages
- How to compile Bootstrap assets.
- How to install Bootstrap Auth Scaffolding.
- How to use complied Bootstrap CSS and JS in Laravel blade template
Laravel Bootstrap 4
Bootstrap is a CSS framework that provides user-friendly UI components to build a next-level web or mobile application.
Install Laravel Project
First of all we need to create a fresh laravel project, download and install Laravel 8 using the below command
1 |
composer create-project laravel/laravel --prefer-dist laravel-bootstrap |
Switch to the newly created project directory.
1 |
cd laravel-bootstrap |
Install Laravel/UI
Now, switch the laravel project directory and run the following composer command to install laravel/ui package.
1 |
composer require laravel/ui |
Install Bootstrap in Laravel 8
Run following artisan command to install Bootstrap in your Laravel project.
1 |
php artisan ui bootstrap |
Install Bootstrap Auth Scaffolding
Use the following artisan command to Install the auth scaffoldings with Bootstrap.
1 |
php artisan ui bootstrap --auth |
We have successfully installed the bootstrap, and you can make sure by going to resource/js/bootstrap.js. You will see that popper.js and jQuery have been added to the bootstrap’s JavaScript file.
Install Bootstrap Packages
Now, we need to make sure we have Node installed on your local development system. Run the following command to check node installation.
1 2 3 4 5 |
# for node node -v # for npm npm -v |
Now, you need to install the bootstrap package and the related frontend dependencies such as jquery from npm using the following command: