Introduction to Laravel Breeze

Laravel Breeze is the most lightweight and beginner-friendly authentication starter kit in the Laravel ecosystem. It provides basic scaffolding for user registration, login, password reset, email verification, and session management. Breeze is designed with simplicity in mind and serves as a great starting point for developers who want to implement authentication quickly without needing a complex frontend framework or advanced tools.

Whether you’re building a personal project, a prototype, or a production application that uses Laravel’s default Blade templates, Laravel Breeze offers a clean and minimal structure. It integrates tightly with Laravel’s powerful authentication features and provides optional support for Tailwind CSS, Laravel Blade templates, or the Inertia stack powered by Vue or React. This makes Breeze a flexible and highly practical starting point for both beginners and experienced developers.

In this comprehensive guide, we will explore everything there is to know about Laravel Breeze, including its installation, structure, routes, controllers, Blade views, Tailwind integration, customization options, extending features, understanding its authentication flow, comparing it with other starter kits, and best practices.

What Is Laravel Breeze

Laravel Breeze is a minimal authentication scaffolding package built by the Laravel team. It provides the essential authentication features without bundling in complex UI frameworks or advanced tooling. Breeze is ideal for developers who want full control over their application’s frontend and backend while still having a solid, ready-made authentication base.

The philosophy behind Breeze is simplicity. It stays close to core Laravel, uses clean Blade templates, and relies on Tailwind CSS for styling. Breeze is perfect for those who want to learn how authentication works under the hood or build a UI from scratch while avoiding boilerplate code.


Why Laravel Breeze Exists

Before Breeze, Laravel offered Laravel UI and Jetstream as starting points.

Laravel UI is older and uses Bootstrap, while Jetstream is feature-rich but complex, offering two-factor authentication, API tokens, and team management. Breeze fills the gap by offering:

  • A clean, modern UI
  • Basic authentication features
  • Lightweight dependencies
  • Easy customization
  • Beginner-friendly learning curve

It allows developers to start small and grow their application step by step without being overwhelmed.


Installing Laravel Breeze

Installing Laravel Breeze is straightforward. Navigate to your Laravel project directory and run:

composer require laravel/breeze

After installing the package, run:

php artisan breeze:install

This installs the scaffolding, including Blade templates and Tailwind CSS setup. Finally, install frontend dependencies:

npm install && npm run dev

After running the above commands, Breeze is ready to use.


Understanding the Laravel Breeze Installation Command

The Artisan command breeze:install adds:

  • Authentication controllers
  • Authentication routes
  • Blade views
  • Tailwind configuration
  • Logout logic
  • Password reset system
  • Basic styling scaffolding
  • Inertia stack if chosen

You can customize the installation by specifying the frontend stack.


Choosing Your Breeze Stack

Laravel Breeze supports multiple stacks. You can generate:

  • Blade + Tailwind (default)
  • Inertia + Vue
  • Inertia + React
  • API-only mode with Laravel Sanctum

Examples:

Install Breeze with Vue:

php artisan breeze:install vue

Install Breeze with React:

php artisan breeze:install react

Install API-only Breeze:

php artisan breeze:install api

Breeze Folder Structure After Installation

After installation, Breeze creates several new files and directories.

The key additions include:

routes/
auth.php
resources/views/auth/ resources/views/layouts/ resources/views/components/ app/Http/Controllers/Auth/

It also modifies:

resources/css
resources/js

Routes Added by Breeze

Breeze adds a set of authentication routes inside routes/auth.php.

Examples include:

GET /login
GET /register
POST /login
POST /register
POST /logout
GET /forgot-password
POST /forgot-password
GET /reset-password/{token}
POST /reset-password

These routes are loaded automatically by Laravel.


Controllers Added by Breeze

Breeze scaffolds a number of controllers under:

app/Http/Controllers/Auth/

These include:

  • AuthenticatedSessionController
  • RegisteredUserController
  • PasswordResetLinkController
  • NewPasswordController
  • EmailVerificationPromptController
  • VerifyEmailController
  • ConfirmablePasswordController
  • ConfirmPasswordController
  • EmailVerificationNotificationController

These controllers handle login, registration, password reset, and email verification.


Blade Templates Generated by Breeze

The default Breeze installation uses Blade templates stored in:

resources/views/auth/

These include:

  • login.blade.php
  • register.blade.php
  • forgot-password.blade.php
  • reset-password.blade.php
  • verify-email.blade.php
  • confirm-password.blade.php

Each of these templates is clean and uses Tailwind CSS for layout and styling.


Layouts and Components Provided by Breeze

Breeze creates a global layout file:

resources/views/layouts/app.blade.php

And various reusable components:

resources/views/components/

Examples include:

button.blade.php
input.blade.php
label.blade.php
dropdown.blade.php
auth-session-status.blade.php
auth-validation-errors.blade.php

These components improve code reuse and simplify building forms.


Breeze and Tailwind CSS

Breeze includes Tailwind CSS by default. When installed, Breeze adds:

  • Tailwind configuration file
  • PostCSS configuration
  • Basic Tailwind setup

The Blade templates use Tailwind classes for styling.

Example Tailwind class usage:

class="block mt-1 w-full"

This gives Breeze a modern, clean, responsive design.


Authentication Logic Behind Breeze

The Breeze authentication system relies on Laravel’s built-in authentication features such as:

  • Guard system
  • Session management
  • Password hashing
  • Email verification
  • Middleware protection

When a user logs in, the AuthenticatedSessionController calls:

Auth::attempt($request->only('email', 'password'))

Laravel then creates a session and logs the user in.


Login Flow in Breeze

Here’s an overview of the login flow:

  1. User visits /login
  2. Breeze displays the login form
  3. Form submits a POST request
  4. Breeze controller validates input
  5. Auth::attempt authenticates the user
  6. User is redirected to the dashboard

The login system is simple and easy to modify.


Registration Flow in Breeze

The registration flow is equally straightforward:

  1. User visits /register
  2. Breeze displays registration form
  3. Form submits to RegisteredUserController
  4. User data is validated
  5. Password is hashed automatically
  6. New user is stored
  7. User is logged in automatically

Breeze also supports password confirmation and email verification.


Password Reset Flow in Breeze

Breeze includes Laravel’s full password reset feature:

  1. User visits /forgot-password
  2. Enters email address
  3. Breeze sends reset link
  4. User clicks link and visits reset page
  5. Enters new password
  6. Password is updated

All logic is handled through Breeze controllers and Laravel’s password broker.


Email Verification Flow With Breeze

Email verification is enabled using Laravel’s built-in features.

Flow:

  1. After registering, user is directed to a verification notice
  2. User receives email with link
  3. Clicking the link verifies the account
  4. User gains access to protected routes

Middleware such as verified is used to protect routes.


Breeze Middleware

Breeze uses standard Laravel middleware:

  • auth for protecting routes
  • guest for blocking logged-in users
  • verified for email verification
  • throttle for limiting login attempts

These are defined in the route files and controllers.


Dashboard Route and Home Page

After successful login or registration, Breeze redirects the user to:

/dashboard

The dashboard is generated at:

resources/views/dashboard.blade.php

This page is simple and built with Tailwind CSS.


Customizing Breeze Views

Because Breeze uses Blade, customizing is straightforward:

  • Modify layout files
  • Edit auth form templates
  • Change CSS classes
  • Add custom components

Example customizing login page:

resources/views/auth/login.blade.php

Adding Fields to Registration

To add custom fields to Breeze:

  1. Update the registration Blade view
  2. Add new fields to the validator
  3. Save fields in controller
  4. Update migration

Breeze is lightweight and does not hide details.


Extending Breeze for Two-Factor Authentication

Although Breeze does not provide two-factor authentication out of the box, it can be added manually or by upgrading to Jetstream.

Steps include:

  • Adding a field for two-factor secret
  • Adding QR code generation logic
  • Updating login flow

Using Breeze With Inertia

Breeze supports Inertia.js with Vue or React.

Install Vue version:

php artisan breeze:install vue

Install React version:

php artisan breeze:install react

This gives a full single-page application experience.


Using Breeze in API-Only Mode

Breeze has an API mode that sets up endpoints for mobile and SPA applications.

Install API version:

php artisan breeze:install api

This includes:

  • Register
  • Login
  • Logout
  • Password reset
  • Email verification
  • Token generation with Sanctum

Comparing Breeze With Laravel UI

Laravel UI is older and uses Bootstrap. Breeze is more modern and uses Tailwind.

Differences:

  • Breeze uses Blade and Tailwind
  • UI uses Bootstrap
  • Breeze is simpler
  • UI is deprecated for new projects

Comparing Breeze With Jetstream

Jetstream is a more advanced starter kit.

Jetstream includes:

  • Two-factor authentication
  • Session management
  • API tokens
  • Teams
  • Profile photos

Breeze includes only the basics, but is easier to understand and customize.


When to Use Laravel Breeze

Laravel Breeze is ideal when:

  • You want a simple, clean authentication setup
  • You want to learn how Laravel authentication works
  • You want to build a custom UI
  • You want to start lightweight and scale up
  • You prefer Blade templates
  • You need Inertia support

When Not to Use Breeze

Avoid Breeze if:

  • You need advanced features like teams or API token management
  • You want a fully-featured SPA out of the box
  • You prefer Bootstrap instead of Tailwind

In these cases, Jetstream may be a better fit.


Customizing Authentication Flow

Modify login logic:

AuthenticatedSessionController

Modify registration logic:

RegisteredUserController

Modify password reset:

NewPasswordController

You have full control.


Adding Middleware to Breeze Routes

You can protect routes by adding middleware:

Route::middleware('auth')->group(function () {
Route::get('/profile', [ProfileController::class, 'edit']);
});

Styling Breeze With Tailwind CSS

Tailwind CSS classes make it easy to style forms:

class="bg-blue-500 text-white font-bold"

You can customize Tailwind through:

tailwind.config.js

Using Breeze as a Learning Tool

Because Breeze is minimal, it is excellent for learning topics such as:

  • Authentication
  • Middleware
  • Controllers
  • Sessions
  • Email verification
  • Password resets
  • Authorization basics

It offers a clear view of how Laravel handles these features under the hood.


Breeze and CSRF Protection

Laravel automatically protects forms using CSRF tokens:

@csrf

This is included in Breeze templates.


Breeze and Session Management

Laravel Breeze uses session-based authentication, which is ideal for web applications:

  • Session is stored on server
  • Logged-in state persists
  • Logout destroys the session

The built-in controller handles this logic.


Breeze and Validation

Validation rules exist inside controllers.

Example:

$request->validate([
'email' => ['required', 'email'],
'password' => ['required'],
]);

Breeze and Database Migrations

Breeze depends on these migrations:

  • Create Users table
  • Password resets table
  • Email verification columns

Make sure you run:

php artisan migrate

Breeze Testing Capabilities

Breeze supports automated testing.

Examples:

  • Test registration
  • Test login
  • Test password reset

Laravel provides built-in testing tools for authentication.


Breeze: Best Practices

  • Use Blade components for clean code
  • Don’t modify Breeze core package files
  • Customize views instead
  • Keep controllers simple
  • Use Tailwind utility classes
  • Move business logic to services
  • Use Laravel policies for advanced authorization

Example Code Customizations

Customizing register controller:

$data = $request->validate([
'name' => 'required',
'email' => 'required|email',
'phone' => 'required'
]);

Updating the Blade form:

<input type="text" name="phone">

Limitations of Laravel Breeze

  • No built-in 2FA
  • No profile management by default
  • No team features
  • No API token management
  • No SPA features unless using Inertia

But its simplicity is also its biggest advantage.


When to Upgrade From Breeze

Upgrade to Jetstream or Fortify when you need:

  • Two-factor authentication
  • Single Page Application authentication
  • Advanced account management
  • Team features

Breeze is ideal early on, but larger apps may eventually outgrow it.


Full Authentication Flow Summary

  1. User registers
  2. Email verification optional
  3. User logs in
  4. Session created
  5. Dashboard shown
  6. User logs out
  7. Session destroyed

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *