0

我认为页面上的一切都是正确的 userLogin.php ::guard ('students') -> check (); 命令返回我的用户,但在登录后的页面上,它总是显示用户 null userLogin.php (控制器)

 if(auth::guard('students')->attempt(['email'=>$request->student_mail,'password'=>$request->student_password],false))
            {
                //dd(Auth::guard('students')->check());
               
               return redirect()->route('student.home');
               
            }
            else 
            {
               echo "yannlış";
               
            }

web.php(路由)

Route::post('login', [userLogin::class, 'loginPost'])->name('login.post');

Route::get('student/home', [studentHome::class, 'index'] )->name('student.home')->middleware('auth:students');

Route::get('/', function () {
    return view('login');


});

结果

4

0 回答 0