title: Laravel routes: Breaking when hitting a route in auth middleware
body: <p>I am writing the logic in which the user accepts Terms and Conditions in a separate page and here is the workflow.</p>
  
  <ol>
  <li>The user is logged in</li>
  <li>If they have not accepted the latest Terms and Conditions, show them the <code>/welcome</code> page.</li>
  <li>If they accept them, then there is a link redirecting them to <code>/accept</code></li>
  </ol>
  
  <p>I have got the following routes set up:</p>
  
  <p>
  
  <pre><code>Auth::routes();
  
  // Temp
  Route::get('/', function () {
      return redirect('/login');
  });
  
  Route::get('/logout', 'Auth\LoginController@logout');
  
  Route::post('password/reset/{token}', 'Auth\ResetPasswordController@postReset')-&gt;name('password.request');
  
  // Auth middleware
  Route::group(['middleware' =&gt; ['auth']], function () {
      // Temp
      Route::get('/discovery', function () {
          return view('pages.discovery');
      });
  
      // Temp
      Route::get('/welcome', function () {
          return view('pages.welcome');
      });
  
      Route::get('/accept', 'Auth\LoginController@accept');
  });
  </code></pre>
  
  <p>Issue is that when a user is logged in, redirected to the <code>/welcome</code> page instead of them clicking on the Accept button to be redirected to the <code>/accept</code> route then it breaks with the common message <code>Sorry, the page you are looking for could not be found.</code></p>
  
  <p>I am guessing it's related to middleware. Any ideas?</p>
  
  <p><strong>Update</strong></p>
  
  <pre><code>// Auth middleware
  Route::group(['middleware' =&gt; ['auth']], function () {
  
      Route::get('/accept', 'Auth\LoginController@accept')-&gt;name('terms.accept');
      Route::get('/welcome', function () {
          return view('pages.welcome');
      });
      Route::group(['middleware' =&gt; ['terms']], function () {
          Route::get('/discovery', function () {
              return view('pages.discovery');
          });
  
      });
  });
  </code></pre>
  
  <p>and this is the middleware: </p>
  
  <pre><code>class TermsMiddleware
  {
      /**
       * @var UserService
       */
      protected $userService;
  
      /**
       * TermsMiddleware constructor.
       * @param UserService $userService
       */
      public function __construct(UserService $userService)
      {
          $this-&gt;userService = $userService;
      }
  
      /**
       * Handle an incoming request.
       *
       * @param  \Illuminate\Http\Request $request
       * @param  \Closure $next
       * @return mixed
       */
      public function handle($request, Closure $next)
      {
          if (!$this-&gt;userService-&gt;hasAcceptedTerms()) {
              return redirect('/welcome');
          }
  
          return $next($request);
      }
  }
  </code></pre>