Authentication with Breeze Laravel

Authentication with Breeze Laravel

Authentication with Breeze Laravel

Hello Artisans, In this chapter we'll discuss Laravel Breeze for authentication. Laravel Breeze is an alternative for laravel/ui which one used for authentication till Laravel 7.0. Besides laravel/ui Breeze uses the Tailwind CSS. So if you already complete the third chapter/section you're good to go, if not my recommendation would be please complete the third one.



Note: Tested on Laravel 10.0

Table of Contents

  1. Create New Project
  2. Install & Configure Laravel Breeze
  3. Configure Database and Migrate
  4. Output

Create New Project

Create a new Laravel application via the command line. We can use either composer or Laravel installer.

For Composer

composer create-project laravel/laravel artisanary

Or with Laravel installer

composer global require laravel/installer //first need to install laravel installer
 
laravel new artisanary

Install & Configure Laravel Breeze

To install Laravel Breeze, you just have to fire the below command in your terminal

composer require laravel/breeze --dev

After the installation, we need to publish the authentication views, routes, controllers, and other resources which are needed for our authentication. So, fire the below command in your terminal.

php artisan breeze:install

After installing the Breeze we need to compile the static assets so that we can minify our css and js files. Minified assets can give us a faster load time and a reduced number of HTTP requests. To do so fire the below command.

npm install
npm run watch

Configure Database and Migrate

Now we need to configure the database in our .env file like below

.env
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=breeze
DB_USERNAME=root
DB_PASSWORD=

After setup, we need to run our migrations. So fire the below command in your terminal

php artisan migrate

Output

If you run your project then you can see the following outputs by visiting http://localhost:8000, make sure you serve your application via the serve command by firing

php artisan serve




Thank you for being so supportive!

Reactions

Post a Comment

0 Comments

close