Certainly! Here’s a recommended approach to email verification and forgotten password features for your Laravel 12 app, without using any JS frontend starter kit.
1. Laravel Fortify: The Right Choice
Since you don't want React, Vue, Livewire, or any frontend scaffolding, using Laravel Fortify is ideal. Fortify provides backend endpoints for authentication, registration, password reset, email verification, and more, but doesn't install any frontend code.
2. Setup Steps
a. Install Fortify
Run:
composer require laravel/fortify
php artisan vendor:publish --provider="Laravel\Fortify\FortifyServiceProvider"
b. Register Fortify
In config/app.php providers array, ensure:
App\Providers\FortifyServiceProvider::class,
c. Configure Features
In config/fortify.php, enable these:
'features' => [
Features::registration(),
Features::resetPasswords(),
Features::emailVerification(),
// ... (others as needed)
],
d. Enable Email Verification
User Model:
Implement MustVerifyEmail:
use Illuminate\Contracts\Auth\MustVerifyEmail;
class User extends Authenticatable implements MustVerifyEmail
{
// ...
}
3. Add Routes to Handle Verification and Reset
Fortify publishes all the routes, you just need to link to them from your Blade forms:
- Email verification: after registration, point user to
/email/verify(Fortify provides this). - Send verification email:
POST /email/verification-notification - Check verification: link in the email goes to
/email/verify/{id}/{hash}
Password reset:
- Request:
POST /forgot-password - Form link (sent by email):
/reset-password/{token}
4. Blade Forms
You need to build the forms/views yourself. For example, for "Forgot password":
<!-- resources/views/auth/forgot-password.blade.php -->
<form method="POST" action="{{ route('password.email') }}">
@csrf
<input type="email" name="email" required autofocus>
<button type="submit">Send Password Reset Link</button>
</form>
For "Reset password":
<!-- resources/views/auth/reset-password.blade.php -->
<form method="POST" action="{{ route('password.update') }}">
@csrf
<input type="hidden" name="token" value="{{ $token }}">
<input type="email" name="email" required autofocus>
<input type="password" name="password" required>
<input type="password" name="password_confirmation" required>
<button type="submit">Reset Password</button>
</form>
And you can copy similar forms for login, registration, etc.
5. Summary / TL;DR
- Fortify gives you full authentication endpoints but no frontend so you control the UI (with Blade).
- You get email verification and password resets "for free"—just hook up the forms and notification templates.
- No React, Vue, or Livewire needed.
- Simple, upgradable, and secure.
If you want more guidance on the Blade side or customizing Fortify's flows, just ask!