If you are beginner with laravel 8 then i’m sure i can help you to install bootstrap 4 in laravel 8. it’s very simple way to install using laravel ui composer package. laravel ui package add laravel 8 support. follow this instructions:
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.
- Bootstrap is a CSS framework, and it provides user-friendly UI components that help to build a next-level web or mobile application. This is a step by step guide on how to use Bootstrap 4 in Laravel.
Step 1: Install a new Laravel 8
composer create-project --prefer-dist laravel/laravel blog
Step 2: Database Configuration
Open the .env file on your text editor and create your database and database connection add this file
Step 3: Install Laravel UI
composer require laravel/ui
Step 4: Install Bootstrap 4
Install a laravel/ui package using Composer, now in this step, we will understand how to easily install the Bootstrap 4 CSS Framework using the following command.
php artisan ui bootstrap
Step 4: Install Bootstrap 4 with auth
Install auth scaffolding bootstrap package in laravel app by using the following command:
php artisan ui bootstrap --auth
You also need to install npm and run it. so let’s run both command:
Finally, you need to install the bootstrap package and the related frontend dependencies such as jquery from npm using the following command
Step 5: Install NPM
Step 6: Run NPM
npm run dev
Step 7: Run php artisan Migrate
open terminal and type the following command on it to create database table:
php artisan migrate
Step 8: Run Development Server
Run Development Server use the following command to start development server:
php artisan serve
Now, open browser and hit the following url on it:
I hope it can help you…