Laravel Email Verification

Laravel Email Verification

Model Preparation

<?php

namespace App;

use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable implements MustVerifyEmail
{
    use Notifiable;

    // ...
}

Database Considerations

Routing

Auth::routes(['verify' => true]);

Views

After Verifying Emails

Protected $redirectTo = '/dashboard';

Events

/**
 * The event listener mappings for the application.
 *
 * @var array
 */
protected $listen = [
    'Illuminate\Auth\Events\Verified' => [
        'App\Listeners\LogVerifiedUser',
    ],
];

Laravel Email Verification — Structure map

Clickable & Draggable!

Laravel Email Verification — Related pages: