How to get registration token?

Viewed 166

After user has registered, I need to afford a link that user can use to re-send his registration.

As I have to pass a token in the link, how would I generate that token?

ex: http://dmain.com/account/confirm/resend/:token

Also, in 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());
        }
    }

So, the link is generated as:

return redirect()->route('frontend.index')->withFlashSuccess(trans('exceptions.frontend.auth.confirmation.resend'));

How would I pass the token to trans?

'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.',
2 Answers
Related