Welcome, it’s great to have you here.

In this tutorial, we learn about how to create User Registration & Login by Bootstrap in Laravel 9

Steps to Create User Registration & Login by Bootstrap

Follow the below simple steps to create Bootstrap Auth Scaffolding in Laravel 9.

Install Laravel 9 Application

Install Laravel UI Package

Install Bootstrap 5 Auth Scaffolding

Install and Run NPM Packages

Database Configuration

Database Migrate

Run Laravel Development Server

Step 1: Install the Laravel 9 Application

Open the terminal or command prompt and navigate to your desired directory where you want to install Laravel 9 application.

Now install the latest Laravel 9 version with the name VictorZilaLaravel9 using the below command.

composer create-project --prefer-dist laravel/laravel VictorZilaLaravel9
Step 2: Install Laravel UI Package

In the second step, first I will change the directory to the VictorZilaLaravel9 location.

cd VictorZilaLaravel9

After That install the Laravel UI package before creating Auth Scaffolding using the below command.

composer require laravel/ui
Step 3: Install Bootstrap Auth Scaffolding

Now in this step, I will install Bootstrap 5 Auth Scaffolding by running the below command.

php artisan ui bootstrap --auth
Step 4: Install and Run NPM Packages

I have successfully created auth scaffolding, so let’s install NPM and Run NPM, run the below commands.

npm install

It will take some time to install node modules completely on your Laravel 9 application, once node modules are installed, then run the NPM Dev using the below command.

Make sure that you have installed Node.js on your machine otherwise, you will not be able to run npm commands. If you do not have it, visit Node.js official website, download, and install it.

npm run dev

Once the Laravel mix is compiled successfully, you will get the following message on your terminal or command prompt.

Step 5: Database Configuration

The most important step is that configure your database credentials on your Laravel 9 app. Go to your application root directory, find .env file, and enter your database credentials like below.

DB_CONNECTION=mysql 
DB_HOST=127.0.0.1 
DB_PORT=3306 
DB_DATABASE=db_name 
DB_USERNAME=db_username 
DB_PASSWORD=db_password
Step 6: Database Migration

Now, it is time to migrate Laravel 9 to all default tables in your database by running the below command.

php artisan migrate
Step 7: Run Laravel Development Server

Now you have successfully completed all the required steps to create Laravel 9 Bootstrap 5 Auth Scaffolding. It is time to start the development server to test the application by using the below command.

php artisan serve

Categorized in: