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()'函數 –