In this blog, you will learn complete Laravel authentication with Breeze. Laravel Breeze provide required methods for login, register, logout, forget password, profile ,reset password page, email verification and much more.
First of all, Let's create new Laravel application. For creating new application, open terminal or command prompt and run this command :
laravel new BreezeExample //Or composer create-project --prefer-dist laravel/laravel BreezeExample
After creating fresh application we need to connect it with database by providing database configuration to .env. To configure database detail like 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
In this step, we will install breeze Auth Scaffolding with composer. For that first of all, change to project directory then enter 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 below command:
php artisan breeze:install
This command will produce output that says Breeze scaffolding installed successfully.
In our application there are few migrations which is created automatically by Laravel framework. like user, failed jobs, personal access token and password reset. So we have to create database table using those migrations.
php artisan migrate
This command will generate database table using migrations.
Before completion we have to compile our assets into our project so application can run flawlessly. That can be achieved by running node js command :
This command will download and install all necessary files. Then we will need to compile into single file, which will improve performance of our application.
npm run prod //or npm run dev
After completing this process our application is ready to test.
For running this application we just have to give following command:
php artisan serve
Now, open browser and hit the following URL on it:
Ask anything about this examples