title: Laravel 4: Add a filter to a route a pass it a controller
body: <p>How to you add a filter to a route and pass a controller to it?. </p>
  
  <p>In Laravel's doc they said that you can add a filter to a route like this:</p>
  
  <pre><code>Route::get('/', array('before' =&gt; 'auth', function()
  {
       return 'Not Authorized';
  }));
  </code></pre>
  
  <p>But I need to pass a controller, like this: </p>
  
  <pre><code>Route::get('/', array('before' =&gt; 'auth', 'HomeController@index'));
  </code></pre>
  
  <p>But I get this error when I do it like that:</p>
  
  <pre><code>call_user_func_array() expects parameter 1 to be a valid callback, no array or string given
  </code></pre>
  
  <p>Any idea?</p>