如果你想检查用户是否认证过,不在路由层而是在视图上,你可以使用@auth和@guest(如示例9-10)
@auth // The user is authenticated @endauth @guest // The user is not authenticated @endguest
你还可以给两个方法传递守护名作为参数来执行守护,如示例9-11
@auth('trainees') // The user is authenticated @endauth @guest('trainees') // The user is not authenticated @endguest
Last updated 5 years ago
Was this helpful?