'Target class [verfied] does not exist in laravel?
I was implementing Auth Email Verfication in sign up, The code used mentioned below.
routes/web.php
Auth::routes(['verify' => true]);
Route::get('/email/verify', function () {
return view('auth.verify-email');
})->middleware('auth')->name('verification.notice');
Route::get('/email/verify/{id}/{hash}', function (EmailVerificationRequest $request) {
$request->fulfill();
return redirect('/home');
})->middleware(['auth', 'signed'])->name('verification.verify');
Route::post('/email/verification-notification', function (Request $request) {
$request->user()->sendEmailVerificationNotification();
return back()->with('message', 'Verification link sent!');
})->middleware(['auth', 'throttle:6,1'])->name('verification.send');
Added verified in middleware
Route::group(['as' => 'user.', 'prefix' => 'user', 'namespace' => 'User', 'middleware' => ['auth', 'user','verfied'], 'where' => ['locale' => '[a-zA-Z]{2}']], function () {
});
Issues
- I am getting verification mail , but when click on 'verify email address' in the mail gives error
- when click on 'sign up' it is directly redirecting to dashboard but it should not allow to redirecting to dashboard without verifying the mail address
where I went wrong?, please give me any solution
Error
production.ERROR: Target class [verfied] does not exist. {"userId":73,"exception":"[object] (Illuminate\Contracts\Container\BindingResolutionException(code: 0): Target class [verfied] does not exist. at /home/hellovcard/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php:811)
.env file
MAIL_MAILER=sendmail
MAIL_HOST=******
MAIL_PORT=465
MAIL_USERNAME=*****
MAIL_PASSWORD=*****
MAIL_ENCRYPTION=ssl
MAIL_FROM_ADDRESS=*****
MAIL_FROM_NAME=*****
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
