php获得注册信息,php – 如何获得注册令牌?

用户注册后,我需要提供一个用户可以用来重新发送注册的链接.

由于我必须在链接中传递令牌,我将如何生成该令牌?

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());

}

}

因此,链接生成为:

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

我如何将令牌传递给trans?

'resend' => 'Your account is not confirmed. Please click the confirmation link in your e-mail, or click here to resend the confirmation e-mail.',

解决方法:

我发现如何通过将变量作为数组传递来执行此操作:

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

标签:php,laravel,laravel-5-2

来源: https://codeday.me/bug/20190706/1396153.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值