title: Laravel 5.4 : Api route list
body: <p>I have the following lines in my <code>routes/api.php</code></p>
  <pre><code>Route::middleware('api')-&gt;get('/posts', function (Request $request) {
      Route::resource('posts','ApiControllers\PostsApiController');
  });
  </code></pre>
  <p>When I hit <code>http://localhost:8000/api/posts</code> it comes back blank, but when I move the above route to <code>routes/web.php</code> like so:</p>
  <pre><code>Route::group(['prefix' =&gt; 'api/v1'],function(){
      Route::resource('posts','ApiControllers\PostsApiController');
  });
  </code></pre>
  <p>it works.</p>
  <p>As a reminder I have cleared the routes cache file with <code>php artisan route:clear</code> and my route list comes with <code>php artisan route:list</code> when my <code>routes/web.php</code> is empty and <code>routes/api.php</code> has the above route:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Domain</th>
  <th>Method</th>
  <th>URI</th>
  <th>Name</th>
  <th>Action</th>
  <th>Middleware</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td></td>
  <td>GET|HEAD</td>
  <td>api/posts</td>
  <td></td>
  <td>Closure</td>
  <td>api</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Note that with web routes part the list comes ok and works fine.</p>
  <p>What am I doing wrong here?</p>