4
用户注册后,我需要负担一个用户可以用来重新发送注册的链接。如何获取注册令牌?
由于我必须在链接中传递令牌,我将如何生成该令牌?
return redirect()->route('frontend.index')->withFlashSuccess(trans('exceptions.frontend.auth.confirmation.resend'));
我怎么会传递令牌反式:
ex: http://dmain.com/account/confirm/resend/:token
此外,在RegistersUsers
public function register(RegisterRequest $request)
{
if (config('access.users.confirm_email')) {
$user = $this->user->create($request->all());
event(new UserRegistered($user));
return redirect()->route('frontend.index')->withFlashSuccess(trans('exceptions.frontend.auth.confirmation.resend'));
} else {
auth()->login($this->user->create($request->all()));
event(new UserRegistered(access()->user()));
return redirect($this->redirectPath());
}
}
因此,如生成的链接?
'resend' => 'Your account is not confirmed. Please click the confirmation link in your e-mail, or <a href="' . route('account.confirm.resend', ':token') . '">click here</a> to resend the confirmation e-mail.',
您可以通过尝试'csrf_token()'函数 –