更新时间:2023-12-03 23:32:16
转到AuthController.php并添加此方法
go to AuthController.php and add this method
其中角色是数据库中定义的用户角色.
where role is the user role as defined in the database.
protected function authenticated($request,$user){
if($user->role === 'admin'){
return redirect()->intended('admin'); //redirect to admin panel
}
return redirect()->intended('/'); //redirect to standard user homepage
}