title: Laravel ioc automatic resolution - works from controller but not from custom class
body: <p>Namespaces omitted for brevity...</p>
  
  <p>I have written the following service provider and registered in config/app.php:</p>
  
  <pre><code>class OfferServiceProvider extends ServiceProvider
  {
      public function register()
      {
          $this-&gt;registerLossControlManager();
      }
  
      protected function registerLossControlManager()
      {
          $this-&gt;app-&gt;bind('LossControlInterface', 'LossControl');
      }
  }
  </code></pre>
  
  <p>Here is my LossControlInterface</p>
  
  <pre><code>interface LossControlInterface
  {
      /**
       * @param int $demandId
       * @param float $offerTotal
       * @param float $productTotal
       * @param null|int $partnerId
       * @return mixed
       */
      public function make($demandId, $offerTotal, $productTotal, $partnerId = null);
  
      /**
       * @return float
       */
      public function getAcceptableLoss();
  
      /**
       * @return bool
       */
      public function isAcceptable();
  
      /**
       * @return bool
       */
      public function isUnacceptable();
  
      /**
       * @return null
       */
      public function reject();
  }
  </code></pre>
  
  <p>Now within the controller, I can inject the LossController as follows:</p>
  
  <pre><code>use LossControlInterface as LossControl;
  
  class HomeController extends BaseController {
     public function __construct(LossControl $lossControl)
      {
          $this-&gt;lossControl = $lossControl;
      }
  
      public function getLossThresholds()
      {
          $lossControl = $this-&gt;lossControl-&gt;make(985, 1000, null);
  
          var_dump('Acceptable Loss: ' . $lossControl-&gt;getAcceptableLoss());
          var_dump('Actual Loss: ' . $lossControl-&gt;calculateLoss());
          var_dump('Acceptable? ' . $lossControl-&gt;isAcceptable());
  
      }
  }
  </code></pre>
  
  <p>However if I try to dependency inject the LossControlInterface from within a custom class called by a command:</p>
  
  <pre><code>[2014-09-02 13:09:52] development.ERROR: exception 'ErrorException' with message 'Argument 11 passed to Offer::__construct() must be an instance of LossControlInterface, none given, called in /home/vagrant/Code/.../ProcessOffer.php on line 44 and defined' in /home/vagrant/Code/.../Offer.php:79
  </code></pre>
  
  <p>It appears as though I am unable to dependency inject the interface into a custom class, but I can when dependency injecting into a controller.</p>
  
  <p>Any thoughts on what Im doing wrong or have omitted to get the automatic resolution working?</p>