loadViewsFrom(__DIR__ . '/../../resources/views', 'partner'); // Load translation $this->loadTranslationsFrom(__DIR__ . '/../../resources/lang', 'partner'); // Load migrations $this->loadMigrationsFrom(__DIR__ . '/../../database/migrations'); // Call pblish redources function $this->publishResources(); } /** * Register the service provider. * * @return void */ public function register() { $this->mergeConfig(); $this->registerPartner(); $this->registerFacade(); $this->registerBindings(); //$this->registerCommands(); } /** * Register the application bindings. * * @return void */ protected function registerPartner() { $this->app->bind('partner', function($app) { return new Partner($app); }); } /** * Register the vault facade without the user having to add it to the app.php file. * * @return void */ public function registerFacade() { $this->app->booting(function() { $loader = \Illuminate\Foundation\AliasLoader::getInstance(); $loader->alias('Partner', 'Lavalite\Partner\Facades\Partner'); }); } /** * Register bindings for the provider. * * @return void */ public function registerBindings() { // Bind facade $this->app->bind('btravel.partner', function ($app) { return $this->app->make('Btravel\Partner\Partner'); }); // Bind Partner to repository $this->app->bind( 'Btravel\Partner\Interfaces\PartnerRepositoryInterface', \Btravel\Partner\Repositories\Eloquent\PartnerRepository::class ); $this->app->register(\Btravel\Partner\Providers\AuthServiceProvider::class); $this->app->register(\Btravel\Partner\Providers\RouteServiceProvider::class); } /** * Merges user's and partner's configs. * * @return void */ protected function mergeConfig() { $this->mergeConfigFrom( __DIR__ . '/../../config/partner.php', 'partner' ); } /** * Register scaffolding command */ protected function registerCommands() { if ($this->app->runningInConsole()) { $this->commands([ Commands\MakePartner::class, ]); } } /** * Get the services provided by the provider. * * @return array */ public function provides() { return ['btravel.partner']; } /** * Publish resources. * * @return void */ private function publishResources() { // Publish configuration file $this->publishes([__DIR__ . '/../../config/config.php' => config_path('btravel/partner.php')], 'config'); // Publish admin view $this->publishes([__DIR__ . '/../../resources/views' => base_path('resources/views/vendor/partner')], 'view'); // Publish language files $this->publishes([__DIR__ . '/../../resources/lang' => base_path('resources/lang/vendor/partner')], 'lang'); // Publish public files and assets. $this->publishes([__DIR__ . '/public/' => public_path('/')], 'public'); } }