Laravel authentication using breeze

In this blog, you will learn to complete Laravel authentication with Breeze. Laravel Breeze provides the required methods for login, register, logout, forget password, profile, reset password page, email verification, and much more.

  1. Install Laravel App
  2. Connect the application with the database
  3. Install Breeze Auth Scaffolding
  4. Database Migrations
  5. Install Npm Packages and Run Production
  6. Run and Test

Create Laravel Application

First of all, Let’s create a new Laravel application. To create a new application, open the terminal or command prompt and run this command:

composer create-project --prefer-dist laravel/laravel BreezeExample

Database Connection With our application

After creating a fresh application we need to connect it with the database by providing database configuration to .env. To configure database details like the following:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=Your database name
DB_USERNAME=database user name
DB_PASSWORD=database password

Install breeze Auth Scaffolding

In this step, we will install breeze Auth Scaffolding with Composer. For that first of all, change to the project directory then enter the below command.

composer require laravel/breeze --dev

This command will download all necessary files. after download completion, we have to install it to our application with the below command:

php artisan breeze:install

This command will produce output that says Breeze scaffolding installed successfully.

Database Migrations

In our application, there are a few migrations that are created automatically by the Laravel framework. like user, failed jobs, personal access tokens, and password reset. So we have to create a database table using those migrations.

php artisan migrate

This command will generate a database table using migrations.

Install Npm Packages and Run Production

Before completion, we have to compile our assets into our project so the application can run flawlessly. That can be achieved by running the node js command :

npm install

This command will download and install all necessary files. Then we will need to compile it into a single file, which will improve the performance of our application.

npm run prod
//or
npm run dev

After completing this process our application is ready to test.

Run and test the application

To run this application we just have to give the following command:

php artisan serve

Now, open the browser and hit the following URL on it:

http://127.0.0.1:8000