Laravel auth middleware on specific resource routes only
Apply an auth middleware to only certain routes in a Laravel resource route without needing to write out each route individually. Generally a CRUD resource route looks like this in…
Apply an auth middleware to only certain routes in a Laravel resource route without needing to write out each route individually. Generally a CRUD resource route looks like this in…
How to make registered users verify their account email before using the Laravel application. With the baseline Laravel authentication framework Breeze when a user registration or sign-up occurs the user…
A guide on sending an email when a user registers on your Laravel application. This gives you a near-instant notification on registration activity. Whilst the user gets a welcome and…
Use a custom email template blade file for your Laravel password reset email with just 6 lines of code. Open app/Providers/AuthServiceProvider.php in the boot() function paste and edit the following:…
Use your own email template blade file for the user verification email in Laravel, instead of the default email layout. Sending a custom verification email is quite simple, all you…
How to run an event or function when a user verifies their account by using a Laravel listener. Start by creating a listener in Artisan php artisan make:listener SendVerifiedWelcomeMail You…
How to create and use a custom middleware in Laravel 9. A middleware means that any HTTP request for that route must pass through it, making it good for checking…
How to clear all of the different Laravel cache types using the Laravel Artisan console. Clearing the application cache The application cache or simply said as “cache” is the data…
Validating a registration form in Laravel to return an error message if the submitted username already exists. This can be used for other fields like an email address or a…
How to have randomly generated strings as user ids in Laravel instead of incrementing integers. By having random strings for identification you can avoid revealing how many users you have,…