8 Laravel Breeze Lab
8 Laravel Breeze Lab
Frontend Components
Laravel Breeze
Laravel Breeze is a simple starter kit that provides everything you need for an average
Laravel application to allow your users to sign up, log in, and manage their profiles.
Installing Breeze
Breeze is intended to be installed on new apps, so it’s usually the first thing you’ll
install when you spin up a new app:
cd myProject
Once you run the installer, you’ll be prompted to choose a stack: Blade, Inertia with
React, Inertia with Vue, or API, which is meant to power a non-Inertia frontend like Next.js.
These stacks are explained in the following section.
After Breeze is installed, make sure to run your migrations and build your frontend:
npm install
Breeze automatically registers routes for registration, login, logout, password reset, email
verification, and password confirmation pages. These routes live in a new routes/auth.php
file.
The non-API form of Breeze also registers routes for a dashboard and an “edit
profile― page for users, and adds these routes directly to the routes/web.php file.
The non-API form of Breeze also publishes controllers for the “edit profile― page,
email verification, password resets, and several other authentication-related features. In
addition, it adds Tailwind, Alpine.js, and PostCSS (for Tailwind). Beyond these shared files
and dependencies, each stack adds its own, unique to its needs:
Breeze Blade
Breeze Blade comes with a series of Blade templates for all the features mentioned
above, which you can find in resources/views/auth, resources/view/components,
resources/views/profile, and a few others sprinkled around.
Breeze Inertia
Both Inertia stacks bring in Inertia, Ziggy (a tool for generating URLs to Laravel
routes in JavaScript), Tailwind’s “forms― component, and the necessary
JavaScript packages to make their respective frontend frameworks function. They
both also publish a basic Blade template that loads Inertia and a series of React/Vue
components for all the published pages in the resources/js directory.
Breeze API
The API stack for Breeze installs significantly less code and fewer packages than the
other stacks, but it also removes the existing bootstrapped files that come with all new
Laravel apps. The API stack is intended to prepare an app to be only an API backend
for a separate Next.js app, so it removes package.json, all the JavaScript and CSS
files, and all the frontend templates.
Laravel Jetstream
Jetstream builds on Breeze’s functionality and adds even more tooling for starting a new
app; however, it’s a more complicated setup with fewer options for configuration, so
you’ll want to know that you need it before you choose Jetstream over Breeze.
Jetstream, like Breeze, publishes routes, controllers, views, and configuration files. Like
Breeze, Jetstream uses Tailwind, and comes in different tech “stacks.―