Authentication with Laravel Breeze
Scaffold login, register, and password reset flows in minutes.
Authentication with Laravel Breeze is a free PHP Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the PHP Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
What is Laravel Breeze?
Laravel Breeze is a minimal authentication scaffold that provides login, registration, password reset, and email verification out of the box.
Installing Breeze
Install via Composer, then publish and run the installation command.
$ composer require laravel/breeze --dev
$ php artisan breeze:install blade
$ npm install && npm run dev
$ php artisan migrateWhat Breeze Generates
Breeze creates: controllers in App\Http\Controllers\Auth, Blade views in resources/views/auth, and routes in routes/auth.php.
Login Flow
POST to /login with credentials. Laravel validates, authenticates, regenerates the session, and redirects to the intended URL.
Registration Flow
POST to /register with name, email, password. Laravel creates the user and logs them in automatically.
The Auth Facade
Use the Auth facade to access authentication state anywhere.
<?php
if (auth()->check()) {
$user = auth()->user();
$id = auth()->id();
}
auth()->logout();
// Or attempt login manually:
$success = auth()->attempt(["email" => $email, "password" => $password]);Remember Me
Pass true as the second argument to attempt() to set a long-lived "remember me" cookie.
<?php
auth()->attempt($credentials, $remember); // $remember is boolPassword Hashing
Laravel hashes passwords with bcrypt by default. The Hash facade provides make() and check().
<?php
$hashed = Hash::make("secret123");
$valid = Hash::check("secret123", $hashed); // trueEmail Verification
Implement the MustVerifyEmail contract on the User model. Breeze adds verification routes automatically.
<?php
class User extends Authenticatable implements MustVerifyEmail { }Password Reset
Breeze generates forgot-password and reset-password flows. Laravel stores reset tokens in the password_reset_tokens table.
Breeze vs Jetstream vs Fortify
Breeze: minimal Blade UI. Jetstream: feature-rich (2FA, teams, API tokens). Fortify: backend-only auth (no views).
Summary
Laravel Breeze provides a complete auth scaffold in minutes. Use auth()->user() to access the authenticated user. Passwords are bcrypt-hashed by default.
Quick Check
How do you get the currently authenticated user?
Frequently asked questions
Is the “Authentication with Laravel Breeze” lesson free?
Yes — the full text of “Authentication with Laravel Breeze” is free to read here on the web, and the PHP Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the PHP Academy course, upgrade to CoddyKit PRO.
What will I learn in “Authentication with Laravel Breeze”?
Scaffold login, register, and password reset flows in minutes. You practise PHP Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start PHP Academy?
No prior experience is required. PHP Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Authentication with Laravel Breeze” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this PHP Academy lesson?
Yes. Every PHP Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Authentication with Laravel Breeze
- Protecting Routes with Middleware
- Gates: Simple Authorization Checks
- Policies: Model-Based Authorization