title: Laravel Interfaces
body: <p>I used the following tutorial to get an idea about interfaces:</p>
  
  <p><a href="http://vegibit.com/what-is-a-laravel-interface/" rel="noreferrer">http://vegibit.com/what-is-a-laravel-interface/</a></p>
  
  <p>But I wanted to change the directory of where I am putting my interfaces to "App/Models/Interfaces". And so I did. But now I cannot get it to work anymore. Here is my code:</p>
  
  <p>Routes.php</p>
  
  <pre><code>App::bind('CarInterface', 'Subaru');
  
  Route::get('subaru', function()
  {
  $car = App::make('CarInterface');  
  $car-&gt;start();
  $car-&gt;gas();
  $car-&gt;brake(); 
  });
  </code></pre>
  
  <p>Model Subaru.php</p>
  
  <pre><code>&lt;?php
  
  use App\Models\Interfaces\CarInterface;
  
  class Subaru implements CarInterface {
  
  ..etc
  </code></pre>
  
  <p>Interface CarInterface</p>
  
  <pre><code>&lt;?php namespace App\Models\Interfaces;
  
  interface CarInterface {
  public function start();
  public function gas();
  public function brake();
  }
  </code></pre>
  
  <p>I added this in my composer.json:</p>
  
  <pre><code>"psr-0": {
  "Interfaces": "app/models/interfaces"
  }
  </code></pre>
  
  <p>And I even added this in my start/global.php file:</p>
  
  <pre><code>ClassLoader::addDirectories(array(
  
  app_path().'/models/interfaces',
  </code></pre>