我期待在存档以下Laravel角色和认证路线
Userlogs - >分配从一个数据库中的特权 - >他们只能看到允许路由仅
到目前为止,我已经能够到达这里:
$user = Usercredential::where('username','=',Auth::user()->username)->get();
foreach ($user as $u) {
$status = $u->userstatus;
$userPriv = $u->userpriviledge;
if ($status == 0){
Session::put('user_priv',$userPriv);
}
else{
return Redirect::to_route('home')->with('message','Inactive users cannot login');
}
哪些检查用户的状态,如果活动或不活动,然后保存在我的会议的特权。接下来是什么?我如何保护我的路线?
感谢
您能否将链接中的相关信息添加到答案中?链接只有答案可以变得没用,如果链接中断。 – Ren