Email Verification Testing

Test email verification functionality in development environment.

@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif

Send Verification Email

@csrf

Method 1: Log Driver (Current)

Status: Active

Configuration: MAIL_MAILER=log

Email Location: storage/logs/laravel.log

Steps to test:

  1. Enter user email above and click send
  2. Check storage/logs/laravel.log
  3. Look for "Verify Email Address" content
  4. Copy verification URL from log
  5. Open URL in browser to verify

Method 2: Mailtrap (Recommended)

Status: Available

Setup Required: Mailtrap account

Setup steps:

  1. Sign up at mailtrap.io
  2. Create inbox and get SMTP credentials
  3. Update .env with Mailtrap settings
  4. Change MAIL_MAILER=smtp
  5. Test emails appear in Mailtrap inbox

Command Line Testing

# Test with existing user

php artisan test:email-verification user@example.com --send --url

# Create test user and send verification

php artisan test:email-verification newuser@test.com --create --send

The custom command provides interactive testing with options to create users, send emails, and generate verification URLs.

Available Test Users

@foreach(\App\Models\User::limit(10)->get() as $user) @endforeach
Email Role Verified Actions
{{ $user->email }} {{ ucfirst(str_replace('_', ' ', $user->role)) }} @if($user->hasVerifiedEmail()) Yes @else No @endif