问题
In Laravel 4 I'm developing 2 distinct workbench packages at the same time. Packages work in conjunction but I want to keep things separated. When they will be ready, the second will depend on the first one through Composer and everything will run well (hope so)... but now: How to make the first ServiceProvider auto boot the second ServiceProvider without writing two lines in /app/config/app.php ??
Now they work great adding two lines into 'providers' in /app/config/app.php but I just want to add one line to keep things easier. Thanks
回答1:
You can call the register method to do this, directly in your service provider.
$this->app->register('YourServiceProvider');
If you wish to call the register method outside a service provider, you will need to use the App
Facade.
App::register('YourServiceProvider');
来源:https://stackoverflow.com/questions/18982603/how-laravel-workbech-package-can-auto-boot-another-workbench-package