所以我有一个Laravel应用程序,但是我已经覆盖了默认sendEmailVerificationNotification功能App\User.php。因为我不想要默认的电子邮件。
现在,当我注册时,我会收到一封电子邮件和激活信息……一切正常。但是,当我单击链接时,出现500错误...因此,我去查看日志并看到以下错误:
Class 'App\Http\Controllers\Auth\Verified' not found
现在,确实不存在该课程,因为我不知道在该课程中应该做什么...
在我User.php的verify方法中,方法如下;
public function verify(Request $request): Response
{
if ($request->route('id') != $request->user()->getKey()) {
throw new AuthorizationException;
}
if ($request->user()->hasVerifiedEmail()) {
return redirect($this->redirectPath());
}
if ($request->user()->markEmailAsVerified()) {
event(new Verified($request->user()));
toastr()->success('Uw email is geverifiëerd', 'Gelukt!', ['timeOut' => 5000]);
}
return redirect($this->redirectPath())->with('verified', true);
}
完整的错误是这样的:
[2019-04-14 11:57:29]登台。错误:找不到类'App \ Http \ Controllers \ Auth \ Verified'{“ userId”:3,“ exception”:“ [对象](Symfony \ Component \ Debug \ Exception \ FatalThrowableError(代码:0):在/var/www/rpr/releases/20190414113903/app/Http/Controllers/Auth/VerificationController.php:60上找不到类'App \ Http \ Controllers \ Auth \ Verified' )
第60行VerficationController.php是}if语句的hasVerifiedEmail。
有人可以解释一下我如何才能验证用户并发出帐户已验证的通知吗?
MYYA
回首忆惘然