title: Laravel 8 route login not defined
body: <p>I'm having some issues with authentication middleware in Laravel 8. At present, when I run my tests I get the error <code>Symfony\Component\Routing\Exception\RouteNotFoundException: Route [login] not defined</code>.</p>
  <p>I've installed <code>jetstream</code> and <code>livewire</code> and can see these in my <code>routes</code> folder. My test should be redirecting to <code>login</code> as there is no user logged in. I am assuming this is an issue with the <code>middleware('auth')</code> not going where it needs to, but I can't find any information on how to solve it.</p>
  <p>This is my test:</p>
  <pre><code>&lt;?php
  
  namespace Tests\Feature;
  
  use App\Models\Project;
  use App\Models\User;
  use Illuminate\Foundation\Testing\RefreshDatabase;
  use Illuminate\Foundation\Testing\WithFaker;
  use Tests\TestCase;
  
  class ProjectsTest extends TestCase
  {
      use WithFaker, RefreshDatabase;
  
      /** @test */
      public function only_authenticated_users_can_create_projects()
      {
          $this-&gt;withoutExceptionHandling();
  
          $attributes = Project::factory()-&gt;raw();
          $this-&gt;post('/projects', $attributes)-&gt;assertRedirect('login');
      }
  }
  </code></pre>
  <p>Routes</p>
  <pre><code>&lt;?php
  
  use Illuminate\Support\Facades\Route;
  
  /*
  |--------------------------------------------------------------------------
  | Web Routes
  |--------------------------------------------------------------------------
  |
  | Here is where you can register web routes for your application. These
  | routes are loaded by the RouteServiceProvider within a group which
  | contains the &quot;web&quot; middleware group. Now create something great!
  |
   */
  
  Route::get('/', function () {
      return view('welcome');
  });
  
  Route::get('/projects', 'ProjectsController@index')-&gt;middleware('auth');
  Route::get('/projects/{project}', 'ProjectsController@show');
  Route::post('/projects', 'ProjectsController@store')-&gt;middleware('auth');
  
  
  Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])-&gt;name('home');
  
  Route::middleware(['auth:sanctum', 'verified'])-&gt;get('/dashboard', function () {
      return view('dashboard');
  })-&gt;name('dashboard');
  
  </code></pre>
  <p>ProjectsController</p>
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  
  use App\Models\Project;
  use App\Models\User;
  
  class ProjectsController extends Controller
  {
  
      public function index()
      {
          //Return all projects. Compact creates an array made up of both variables and values.
          $projects = auth()-&gt;user()-&gt;projects;
          return view('projects.index', compact('projects'));
      }
  
      public function show(Project $project)
      {
          //Get the wildcard no passed in as a reference and search for it in Project. If it doesn't exist, fail.
          return view('projects.show', compact('project'));
      }
  
      public function store()
      {
          //validate - check for title/description
          $attributes = request()-&gt;validate([
              'title' =&gt; 'required',
              'description' =&gt; 'required',
          ]);
          //Use middleware to check owner is logged in and then pass in project
          auth()-&gt;user()-&gt;projects()-&gt;create($attributes);
          //redirect - return a new view
          return redirect('/projects');
      }
  }
  
  </code></pre>