DEV Community

Cover image for Laravel Breeze Quick Setup
larawell-done
larawell-done

Posted on

Laravel Breeze Quick Setup

Laravel Breeze is a minimalist starter kit for building Laravel-based web applications. It provides a simple authentication system, basic UI components, and a few pre-built routes and views to help developers get started quickly. In this blog post, we will guide you through the steps to install Laravel Breeze in your Laravel application.

Step 1: Create a new Laravel application

First, you need to create a new Laravel application using the Composer command. Open your terminal and navigate to the directory where you want to create your new Laravel application. Then, run the following command:

composer create-project --prefer-dist laravel/laravel <project-name>
Enter fullscreen mode Exit fullscreen mode

Replace <project-name> with the name of your project. This command will download the latest version of Laravel and create a new Laravel application in the specified directory.

Step 2: Install Laravel Breeze

Once you have created your Laravel application, you can install Laravel Breeze using Composer. In your terminal, navigate to the root directory of your Laravel application and run the following command:

composer require laravel/breeze --dev
Enter fullscreen mode Exit fullscreen mode

This command will install Laravel Breeze as a development dependency.

Step 3: Generate authentication scaffolding

Next, you need to generate the authentication scaffolding using the following command:

php artisan breeze:install
Enter fullscreen mode Exit fullscreen mode

This command will generate the basic authentication routes, views, and controllers needed for user registration, login, and password reset. If asked select the stack(blade|react|vue|api) that you want to install, It will also install the necessary NPM packages for the authentication UI components.

Step 4: Run migrations

The authentication scaffolding includes a users table, so you need to run the database migrations to create this table. Run the following command to run the migrations:

php artisan migrate
Enter fullscreen mode Exit fullscreen mode

Step 5: Compile assets

Once the authentication scaffolding has been generated, you need to compile the assets using the following command:

npm install && npm run dev
Enter fullscreen mode Exit fullscreen mode

This command will install the required NPM packages and compile the assets.

Step 6: Test the authentication system

That's it! You have now installed Laravel Breeze and generated the basic authentication scaffolding. With your application server up and running(php artisan serve) you can test the authentication system by navigating to the /register and /login routes in your application.

register

Conclusion, Laravel Breeze is a great starting point for building Laravel-based web applications that require basic authentication features. With just a few simple steps, you can quickly set up an authentication system and get started with your application development.

Top comments (0)