title: Laravel 4: loading Service Provider at runtime
body: <p>On first thought, this may seem unnecessary, as we have defined <code>providers</code> in <code>config/app.php</code> to autoload any <code>ServiceProvider</code>, but it turns out there is a scenario where they will NOT be autoloaded:</p>
  
  <p>When we run a job from Laravel <code>Queue</code> - it would seem my <code>ServiceProvider</code> in config are ignore completely, so DI failed with <code>target ... is not instantiable</code>.</p>
  
  <p>Register my service providers at runtime in the job does work. e.g. </p>
  
  <pre><code>App::register('MyServiceProvider');
  </code></pre>
  
  <p>Is there a reason that Laravel did not autoload my ServiceProvider in such case?</p>
  
  <p>PS: I opened an issue <a href="https://github.com/laravel/framework/issues/2571" rel="nofollow">on github</a> as well, as I am not if this is by design.</p>