title: Call to a member function middleware() on null
body: <p>I use the following middleware in routing Laravel:</p>
  
  <pre><code>Route::group(['prefix' =&gt; 'api/'], function() {
      Route::resource('admin', 'adminController')-&gt;middleware('auth');
      Route::resource('profile', 'profileController')-&gt;middleware('role');
  }); 
  </code></pre>
  
  <p>I get this error when i call 'admin' or 'profile' path in URL
  <a href="https://i.stack.imgur.com/Lh0rr.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Lh0rr.png" alt="enter image description here"></a></p>