2
votes

I have updated my Laravel project from 5.6 to 5.7. Laravel 5.7 comes with the new email verification so I tried to build that in my new project. I folowed the instructions on the update guide from the Laravel docs, but after registering a new user on my site, I receive the message: Class verified does not exist. It does send me an email, so that part works just fine. But I think I'm missing something in my middleware, because the docs say we have to add: Auth::routes(['verify' => true]); instead of the original Auth::routes();

Did anybode had the same problem like I did?

1
Did you add 'implements MustVerifyEmail' to your User class and add ->middleware('verified') to the page you want to protect?Polaris
Yes, I did. Route::get('dashboard', 'HomeController@index')->name('home.dashboard')->middleware('verified'); And also the HomeController has a construct with: $this->middleware(['auth', 'verified']);Ruub
The verify link in the email also works just fine. I can verify my account and it updates the email_verified_at column in the DB with the current date.Ruub

1 Answers

14
votes

Ensure that you have registered the verified middleware in App\Http\Kernel.php:

protected $routeMiddleware = [
    ...
    'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,