
Learn to build a custom authentication system in Laravel with Breeze, from scratch, including a custom user model and guard, registration, login, forgot password, email verification, and custom layouts.
Create a fresh Laravel project, install Breeze, configure the database, run migrations, and enable email verification and password reset for a custom user, while tracking progress on GitHub.
Learn to enable email verification for the default Laravel user by implementing the must verify email contract, sending verification emails via Mailtrap, and enforcing login for verified users.
Define a custom user model and migration with essential columns like name, email, password, and email_verified_at; configure fillable properties, casts, and prepare for custom guards and email verification.
Define a custom guard for the custom user model by extending the authenticator class, configure a custom provider and session guard in auth.php for login, password resets, and email verification.
Adapt the registration flow for a custom user model by leveraging Laravel Breeze. Create a dedicated custom auth namespace, routes, controllers, and views to support registration.
Define a custom user auth middleware in Laravel to check the custom user guard and redirect to login or dashboard. Register it in the kernel and apply to routes.
Create separate layouts for the custom user guard in Laravel. Define a custom user namespace, update blade templates, and adjust navigation to use the custom guard.
Implement login functionality in a custom Laravel auth setup by configuring a custom user guard and login routes. Build the login blade, login request, and authenticated session handling for logout.
implement logout by enabling and wiring the custom user logout route, applying the custom user auth middleware, destroying and regenerating the session, and redirecting to the login page.
Fix the redirectIfAuthenticated middleware for the custom user guard by redirecting authenticated custom users to the custom user home, while preserving existing redirects for other guards.
Begin implementing the email verification flow for a custom user in Laravel by defining verify email routes, a verification prompt controller, and a flexible verify middleware.
Implement resending account verification emails in a Laravel custom auth setup by wiring routes, controllers, and a notification, then sending a verification email with a signed URL and status feedback.
Develop a custom email verification flow in Laravel by overriding the default notification, wiring a custom verify email, and updating routes, guards, and controllers for the custom user.
Implement a custom user email verification flow in Laravel by defining a custom user registered event and listener, wiring them in the event service provider, and emitting on registration.
Learn to implement a Laravel custom forgot password flow by adding the forgot password view, wiring routes and controllers, and configuring the password reset email flow.
Begin implementing the custom password reset flow in Laravel by wiring routes, a new password controller, and custom views, using your own broker and user namespace to reset passwords securely.
Add a conditional check to return the correct password reset URL based on the user model, preserving default behavior for default users and supporting the custom flow.
Implement a custom password reset flow in Laravel by defining a custom password broker, configuring providers and a dedicated tokens table, and routing reset links to a custom user prefix.
learn how to implement a password confirm feature in a custom Laravel auth flow by wiring a confirm password controller, blade, route, and require password middleware.
Implement a flexible require password middleware to power the password confirm feature, prompting users to re-enter their password before accessing sensitive areas like profile, with a custom guard and timeout.
Implement and refine the profile section for a CustomUser in Laravel, including a profile controller, custom auth guard, profile update requests, blade views, and confirm password flow.
Update the registration flow to reference the custom user model in the unique validation rule, and apply the guest layout to the verify email blade.
I wrap up the custom auth implementation in a Laravel project. I preview future authentication topics, including applying features to default and custom users in the breeze package.
In this course, we will learn to implement Custom Authentication in Laravel using the Laravel Breeze package.
We will use Guards to implement Custom Auth and define separate areas for different users.
While building the Custom Authentication functionality, we will work on the following features:
Learn about Guards and assign Guards to a Database Model.
Implement Custom Login/Registration for different Models by following patterns like Code Re-usability and DRY(Don't Repeat Yourself)
Implement Email Verification functionality for the Custom Guards.
Implement Password Reset functionality for Custom Guards and learn how to use Password Brokers provided by Laravel
Implement the Confirm Password flow for the Custom Guard and use it accordingly.
Implement a dedicated Profile Section for the Custom Guard and define logic accordingly.
Define Separate Sections/Layouts based on the custom guards registered in the application.
Along the way, we'll also Learn about:
Routes/Controllers Organization.
Controller sub-folders/namespaces
Views organization using sub-folders for each Area.
Separate Navigation menus for each Area/Section
Route grouping
Route name prefixes
URL prefixes
Also, we'll define individual Middlewares, to protect each area based on its specific Guard
Along with the above concepts, we will also:
Learn how to Read and Reuse the existing code to avoid Code Duplication.
Learn about the essential VS Code extensions every PHP/Laravel developer must use.
Learn a few tips/tricks along the way
And many more