且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如果在Laravel中通过身份验证,则将用户从登录页面重定向到主页

更新时间:2023-09-20 22:12:22

检查用户是否通过身份验证,如果用户通过身份验证,则重定向到首页

Check If user is authenticated and if user is authenticated then redirect to home

Route::get('/', function () {
   if(Auth::check()){return Redirect::to('home');}
    return view('welcome');
});