2016-03-21 6 views
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.', 
+0

あなたは 'csrf_token()'関数を使用して試すことができます –

答えて

1

私はこのような配列として変数を渡すことによってそれを行う方法が見つかりました:

return redirect()->route('frontend.index')->withFlashSuccess(trans('exceptions.frontend.auth.confirmation.resend', array('token' => $token))); 
0

あなたは(トークンがフォームでcsrf_tokenを()を使用して生成される)、申し込み時にリクエストして取得すること_token保存することができます。そして、このトークンをリンクに埋め込まれて送信し、ユーザーを確認することができます。

関連する問題