使用自定义路由进行Laravel身份验证

使用自定义路由进行Laravel身份验证,laravel,laravel-5.7,laravel-authentication,Laravel,Laravel 5.7,Laravel Authentication,在电子邮件验证路由中,我想通过在URL中添加语言来更改路由。e、 例如,我们想要的不是/fr/email/verify,而是/fr/email/verify 路线 //电子邮件验证路由 路由::获取({lg?}/email/verify',身份验证\VerificationController@show') ->名称('验证通知') ->其中(‘lg’,‘fr)|(en’); 在EnsureEmailIsVerified类中,用户将访问“verification.notice”路径: 我没有访

在电子邮件验证路由中,我想通过在URL中添加语言来更改路由。e、 例如,我们想要的不是/fr/email/verify,而是/fr/email/verify

路线

//电子邮件验证路由
路由::获取({lg?}/email/verify',身份验证\VerificationController@show')
->名称('验证通知')
->其中(‘lg’,‘fr)|(en’);
在EnsureEmailIsVerified类中,用户将访问“verification.notice”路径:


我没有访问我的开发机器的权限,但是有一些类似于

Redirect::route('verification.notice', ['lg' => 'en'])


应该可以工作。

我没有访问我的开发机器的权限,但是可以使用

Redirect::route('verification.notice', ['lg' => 'en'])


应该可以工作。

是否需要将en或fr字符串传递给重定向?IE:
Redirect::route('verification.notice','fr')
您当前的重定向工作正常,因为重定向中没有提供
{lg?}
,它会转到/email/verify。您不需要将en或fr字符串传递给重定向吗?IE:
Redirect::route('verification.notice','fr')
您当前的重定向工作正常,因为重定向中没有提供
{lg?}
,它会转到/email/verify