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 https://laravel.com/docs/8.x/verification#the-email-verification-handler
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) {
    $request->fulfill();

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

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

IlluminateContractsContainerBindingResolutionException
Target class [IlluminateFoundationAuthEmailVerificationRequest] does not exist.

Thanks in advance!

Source: Laravel

Leave a Reply