title: Unable to pass class instance to constructor
body: <p>I have installed this package <a href="https://github.com/Intervention/image" rel="nofollow">https://github.com/Intervention/image</a> with composer.  I have added</p>
  
  <p><code>'IntImage' =&gt; 'Intervention\Image\Facades\Image'</code></p>
  
  <p>to config/app under aliases</p>
  
  <p>I get the following error and cant figure out what I am doing incorrectly I am sure it has something to do with namespacing /autoloading but app/acme is in the psr-o section of composer.json</p>
  
  <blockquote>
    <p>'Argument 1 passed to
    Acme\Services\Images\InterventionImageEditor::__construct() must be an
    instance of IntImage, none given, called in
    /var/www/app/ACme/Providers/ImageEditorServiceProvider.php on line 14
    and defined' in
    /var/www/app/Acme/Services/Images/InterventionImageEditor.php:11</p>
  </blockquote>
  
  <p>I have the following directory structure</p>
  
  <pre><code>app
    acme
      Providers
        ImageEditorServiceProvider.php
      Services
        Images
          ImageEditorInterface.php
          InterventionImageEditor.php
  </code></pre>
  
  <p>and the content of the files</p>
  
  <p><em>ImageEditorServiceProvider.php</em></p>
  
  <pre><code>&lt;?php namespace Acme\Providers;
  
  use Illuminate\Support\ServiceProvider;
  use Acme\Services\Images\InterventionImageEditor;
  
  /**
  *
  */
  class ImageEditorServiceProvider extends ServiceProvider
  {
      public function register()
      {
          $this-&gt;app-&gt;bind('Acme\Services\Images\ImageEditorInterface', function () {
              return new InterventionImageEditor();
          });
      }
  }
  </code></pre>
  
  <p><em>ImageEditorInterface.php</em></p>
  
  <pre><code>&lt;?php namespace Acme\Services\Images;
  
  interface ImageEditorInterface
  {
      public function hello();
  }
  </code></pre>
  
  <p><em>InterventionImageEditor.php</em></p>
  
  <pre><code>&lt;?php namespace Acme\Services\Images;
  
  use IntImage;
  
  /**
  *
  */
  class InterventionImageEditor implements ImageEditorInterface
  {
      protected $imageeditor;
  
      public function __construct(IntImage $imageeditor)
      {
          $this-&gt;imageeditor = $imageeditor;
      }
  
      public function hello()
      {
          $hello = 'hello';
  
          return $hello;
      }
  }
  </code></pre>
  
  <p>Can I </p>
  
  <pre><code>Use IntImage;
  </code></pre>
  
  <p>in this way because it is a facade or am I missing something?</p>
  
  <p>edit to include solution;</p>
  
  <p>changing the service provider to the following resolved the problem</p>
  
  <pre><code>&lt;?php namespace Acme\Providers;
  
  use Illuminate\Support\ServiceProvider;
  use Acme\Services\Images\InterventionImageEditor;
  use IntImage;
  
  /**
  *
  */
  class ImageEditorServiceProvider extends ServiceProvider
  {
      public function register()
      {
          $this-&gt;app-&gt;bind('Acme\Services\Images\ImageEditorInterface', function () {
              $intimage = new IntImage;
              return new InterventionImageEditor($intimage);
          });
      }
  }
  </code></pre>