title: Laravel: How to allow a route group to be public?
body: <p>I'm new to Laravel <code>5.6</code> and are trying to write an API with the <strong>public route</strong> <code>/signup</code>.</p>
  
  <p>For JWT auth, I'm using <a href="https://github.com/tymondesigns/jwt-auth" rel="nofollow noreferrer">jwt-auth</a> <code>1.0.0-rc.2</code>.</p>
  
  <p><strong>routes/api.php</strong></p>
  
  <pre><code>// This code WORKS, the route is public
  Route::middleware('guest:api')-&gt;get('/signup', function(Request $request) {
      return "Sign up"; // This code belongs in the controller
  });
  
  // This code DOES NOT WORK, authentification needed
  Route::get('signup', 'AuthController@signup')-&gt;middleware('guest');
  
  // This code DOES NOT WORK
  Route::group([
      'middleware' =&gt; 'guest:api'
  ], function($router) {
      Route::get('signup', 'AuthController@signup');
  });
  </code></pre>
  
  <p>I couldn't find anything useful in the <a href="https://laravel.com/docs/5.6/routing" rel="nofollow noreferrer">docs</a>, but it should be my wrong way of adding the <code>guest</code> permission, as the first example works.</p>
  
  <p>How can I make the the not working code work? Any idea? Thanks!  </p>