title: laravel 8 auth Route [login] not defined
body: <p>'Route [login] not defined ..'
  I'm new to Laravel. I want to make a login system myself, but I still have not solved this error. I am logging in but the user appears blank on the other page, I still cannot control it. I want to use the user restrictions on other pages, how can I do this.</p>
  <p>web.php</p>
  <pre><code>Route::post('login', [userLogin::class, 'loginPost'])-&gt;name('login.post');
  
  Route::get('student/home', [studentHome::class, 'index'] )-&gt;name('student.home')-&gt;middleware('auth:students');
  
  Route::get('/', function () {
      return view('login');
  
      
  </code></pre>
  <p>userLoginController.php</p>
  <pre><code>public function loginPost(Request $request)
  {          
   if(auth::guard('students')-&gt;attempt(['email'=&gt;$request-&gt;student_mail,'password'=&gt;$request-&gt;student_password],false))
      {
         //dd(Auth::guard('students')-&gt;check());
                 
         return redirect()-&gt;intended('student.home');
               
       }
       else 
       {
         echo &quot;yannlış&quot;;
         
        }
  }
  </code></pre>
  <p>auth.php</p>
  <pre><code> 'defaults' =&gt; [
          'guard' =&gt; 'web',
          'passwords' =&gt; 'users',
      ],
  
   'guards' =&gt; [
          'web' =&gt; [
              'driver' =&gt; 'session',
              'provider' =&gt; 'users',
          ],
          'students' =&gt; [
              'driver' =&gt; 'session',
              'provider' =&gt; 'students',
          ],
  
          'api' =&gt; [
              'driver' =&gt; 'token',
              'provider' =&gt; 'users',
              'hash' =&gt; false,
          ],
      ],
  
   'providers' =&gt; [
          'users' =&gt; [
              'driver' =&gt; 'eloquent',
              'model' =&gt; App\Models\User::class,
          ],
          'students' =&gt; [
              'driver' =&gt; 'eloquent',
              'model' =&gt; App\Models\students::class,
          ],
  
  
  </code></pre>