title: Extending Collection in Laravel
body: <p>I'm trying to extend my model collections in Laravel. I'm following these two tutorials here that say I just need to override the <code>newCollection</code> method. Seems pretty straight forward enough, but it seems the <code>newCollection</code> method is not firing.</p>
  
  <p>I'm using Laravel 4.2.</p>
  
  <p><a href="http://www.neontsunami.com/posts/diffing-eloquent-collections-in-laravel-4" rel="nofollow">link1</a></p>
  
  <p><a href="http://heera.it/extend-laravel-eloquent-collection-object#.VBjX9_mSwQM" rel="nofollow">link2</a></p>
  
  <p>My Model:</p>
  
  <pre><code>class City extends Eloquent {
  
      public function newCollection(array $models = Array())
      {
          echo 'here';
          return new Extensions\CityCollection($models);
      }
  }
  </code></pre>
  
  <p>Custom Collection: </p>
  
  <pre><code>&lt;?php namespace Extensions;
  
  echo 'here';
  
  class CityCollection extends \Illuminate\Database\Eloquent\Collection {
  
      public function findInList($name)
      {
          foreach ($this as $city)
          {
              if (strtolower($city-&gt;name) === strtolower($name))
              {
                  return $city;
              }
          }
  
          return false;
      }
  }
  </code></pre>
  
  <p>None of the <code>echo</code> statements are firing. Am I doing something wrong? I've also run a dump-autoload and have added the containing folder to my <code>composer.json</code>.</p>