title: 'auth' Middleware with Route::resource
body: <p>How can I use middleware with resources?</p>
  
  <pre><code>Route::resource('myitem', ['middleware' =&gt; 'auth', 'uses' =&gt; 'App\\Controllers\\MyitemsController']);
  </code></pre>
  
  <p>Just followed <a href="https://laracasts.com/discuss/channels/general-discussion/struggling-with-routeresource-and-auth-middleware" rel="nofollow">https://laracasts.com/discuss/channels/general-discussion/struggling-with-routeresource-and-auth-middleware</a> but unfortunately could not solve.</p>
  
  <p>Getting error:</p>
  
  <pre><code>ErrorException (E_UNKNOWN) 
  Array to string conversion
  Open: /vendor/laravel/framework/src/Illuminate/Routing/Router.php
  
  protected function getResourceAction($resource, $controller, $method, $options)
  {
      $name = $this-&gt;getResourceName($resource, $method, $options);
  
      return array('as' =&gt; $name, 'uses' =&gt; $controller.'@'.$method);
  }
  </code></pre>