那就是我目前正在工作的东西,这是一个巧合。
您还需要将以下几行添加到 LoginController中
namespace AppHttpControllersAuth;use AppHttpControllersController;use IlluminateFoundationAuthAuthenticatesUsers;use IlluminateHttpRequest;class LoginController extends Controller{use AuthenticatesUsers;protected function authenticated(Request $request, $user){if ( $user->isAdmin() ) {// do your magic here return redirect()->route('dashboard');} return redirect('/home');}//protected $redirectTo = '/admin';public function __construct(){ $this->middleware('guest', ['except' => 'logout']);}}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)