Laravel 9 Authentication Scaffolding with Breeze Tutorial

Share this Article
Reading Time: 5 minutes
1,292 Views

For every web application – login & registration must be a needed part. Inside this article we will see Laravel 9 Authentication scaffolding with Breeze. We will do Laravel authentication with breeze.

Laravel founder Taylor otwell released laravel breeze with simple authentication scaffolding. Inside this we will see composer package for breeze. It was initially released with laravel v8. Also we have other packages for authentication as well.

Laravel Breeze is powerful combination by Blade templates and Tailwind. It publishes controllers for authentication system, views and routes to laravel application.

Learn More –

Let’s get started.

Laravel Installation

Open terminal and run this command to create a laravel project.

$ composer create-project laravel/laravel myblog

It will create a project folder with name myblog inside your local system.

To start the development server of laravel –

$ php artisan serve

URL: http://127.0.0.1:8000

Assuming laravel already installed inside your system.

Create Database & Connect

To create a database, either we can create via Manual tool of PhpMyadmin or by means of a mysql command.

CREATE DATABASE laravel_app;

To connect database with application, Open .env file from application root. Search for DB_ and update your details.

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel_app
DB_USERNAME=root
DB_PASSWORD=root

Install Breeze

We need to Install laravel breeze package for the authentication. Open Laravel project to terminal and type the given command.

$ composer require laravel/breeze --dev

While Installation, this will be the screen we get

It will install breeze to application. Now, to install laravel breeze for simple auth scaffolding.

$ php artisan breeze:install

After this command need to run the command

$ npm install && npm run dev

It will generate CSS and JS compiled files for authentication system. After running this, all controllers, routes, views we can find into source code of laravel application.

Run Migration

Next,

We need to run migration command to generate tables in database. Open terminal and run this artisan command.

$ php artisan migrate

Breeze Authentication Controllers

After installation of breeze authentication – You can find several auth related files in your application Like it’s Controllers, Route, View Files.

Authentication controller we can find into the path /app/Http/Controllers/Auth

Breeze Authentication Routes

Application routes configuration we can find into the directory /routes.

Breeze authentication routes, we will find inside auth.php.

This auth.php file is included in web.php i.e main configuration file for routes. Have a look.

web.php -> require DIR.’/auth.php’;

Breeze Authentication Views

Blade template files after generating breeze scaffolding we can find inside path /resources/views/auth

Application Testing

Open project to terminal and type the command to start development server

$ php artisan serve

URL – 127.0.0.1:8000

Login & Register link at landing page

Register Page

URL – 127.0.0.1:8000/register

Login Page

URL – 127.0.0.1:8000/login

Dashboard Page

URL – 127.0.0.1:8000

We hope this article helped you to learn about Laravel 9 Authentication Scaffolding with Breeze in a very detailed way.

Buy Me a Coffee

Online Web Tutor invites you to try Skillshare free for 1 month! Learn CakePHP 4, Laravel APIs Development, CodeIgniter 4, Node Js, etc into a depth level. Master the Coding Skills to Become an Expert in Web Development. So, Search your favourite course and enroll now. Click here to join.

If you liked this article, then please subscribe to our YouTube Channel for PHP & it’s framework, WordPress, Node Js video tutorials. You can also find us on Twitter and Facebook.

Was this post helpful?

Learn Web Development Courses Risk Free @ $5 only.
Web Development Courses @ $5