Target class [IlluminateFoundationAuthEmailVerificationRequest] does not exist

  email-verification, laravel, php

I am doing email verification while user registration in laravel-8.

i have set below codes in routes as per docs
sending verification email working fine but when click on verification link that it give me an error that EmailVerificationRequest class does not exist.

use IlluminateHttpRequest;
use IlluminateFoundationAuthEmailVerificationRequest;
Route::get('/email/verify/{id}/{hash}', function (EmailVerificationRequest $request) {

    return redirect('/home');
})->middleware(['auth', 'signed'])->name('verification.verify');

Error is as below that Email Verification Request class not exist. why?

Target class [IlluminateFoundationAuthEmailVerificationRequest] does not exist.

Thanks in advance!

Source: Laravel

Leave a Reply