Laravel 6 Install Bootstrap 4 Tutorial

Learn how to install Bootstrap 4 in Laravel 6 using the Laravel UI package. This step-by-step guide covers basic setup and authentication scaffolding, making it easy for beginners and pros alike.

Laravel 6 Install Bootstrap 4 Tutorial Image

Are you looking to integrate Bootstrap 4 into your Laravel 6 application? You're in the right place! In this tutorial, I'll walk you through the simple process of installing Bootstrap 4 using the Laravel UI package. Whether you're a beginner or an experienced developer, this guide will make the setup process a breeze.

Laravel UI is a powerful tool that simplifies the installation of frontend frameworks like Bootstrap, Vue, and React. It also provides authentication scaffolding for login and registration systems. Let’s dive into the steps to get Bootstrap 4 up and running in your Laravel 6 project.

Step 1: Install Laravel UI Package

First, you need to install the Laravel UI package using Composer. Run the following command in your terminal:

composer require laravel/ui

Step 2: Install Bootstrap 4

Once the package is installed, you can set up Bootstrap 4 in two ways:

  1. Basic Bootstrap 4 Setup:

    Run the following command to install Bootstrap 4 without authentication scaffolding:

    php artisan ui bootstrap
  2. Bootstrap 4 with Authentication Scaffolding:

    If you want to include authentication features (like login and registration), use this command:

    php artisan ui bootstrap --auth

Step 3: Install and Compile Assets

After setting up Bootstrap, you need to install the required npm packages and compile the assets. Run these commands:

npm install
npm run dev

That’s it! You’ve successfully installed Bootstrap 4 in your Laravel 6 application. Now you can start building your project with a responsive and modern design.

I hope this guide was helpful. If you have any questions, feel free to leave a comment below!

Do you Like?