title: How to extend Laravel's Auth Guard class?
body: <p>I'm trying to extend Laravel's Auth <a href="https://github.com/laravel/framework/blob/master/src/Illuminate/Auth/Guard.php">Guard</a> class by one additional method, so I'm able to call <code>Auth::myCustomMethod()</code> at the end.</p>
  
  <p>Following the documentation section <a href="http://laravel.com/docs/extending">Extending The Framework</a> I'm stuck on how to exactly do this because the Guard class itself doesn't have an own <a href="http://laravel.com/docs/facades#facade-class-reference">IoC binding</a> which I could override.</p>
  
  <p>Here is some code demonstrating what I'm trying to do:</p>
  
  <pre><code>namespace Foobar\Extensions\Auth;
  
  class Guard extends \Illuminate\Auth\Guard {
  
      public function myCustomMethod()
      {
          // ...
      }
  
  }
  </code></pre>
  
  <p>Now how should I register the extended class <code>Foobar\Extensions\Auth\Guard</code> to be used instead of the original <code>Illuminate\Auth\Guard</code> so I'm able to call <code>Auth::myCustomMethod()</code> the same way as e.g. <code>Auth::check()</code>?</p>
  
  <p>One way would be to replace the <code>Auth</code> alias in the <code>app/config/app.php</code> but I'm not sure if this is really the best way to solve this.</p>
  
  <p>BTW: I'm using Laravel 4.1.</p>