I am working on a composer package which is used by multiple laravel 5 application so I have a service provider in there which hooks the goodies into laravel 5 application when installed in one.
I know I can register service providers for dependent packages like so:
$this->app->register(\Tymon\JWTAuth\Providers\JWTAuthServiceProvider::class);
$this->app->register(\EvanDarwin\JSend\Laravel\ServiceProvider::class);
$this->app->register(\Prettus\Repository\Providers\RepositoryServiceProvider::class);
I know I can also load aliases like so:
$loader = \Illuminate\Foundation\AliasLoader::getInstance();
$loader->alias('Excel', 'Maatwebsite\Excel\Facades\Excel');
$loader->alias('Firewall', 'PragmaRX\Firewall\Vendor\Laravel\Facade');
But what about registering commands and schedule calls? Are there methods to do that too? If yes, how do I do it?
I am newbie trying to learn good OOP practices and I get stuck in such things. So more importantly, where do I go looking for such stuff? Is there documentation for this too? Because I couldn't find this stuff in the Package Development section at laravel.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire