loadViewsFrom(__DIR__ . '/../../resources/views', 'shop'); // Load translation $this->loadTranslationsFrom(__DIR__ . '/../../resources/lang', 'shop'); // 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->registerFacade(); $this->app->register(\Bixo\Shop\Providers\AuthServiceProvider::class); $this->app->register(\Bixo\Shop\Providers\RouteServiceProvider::class); $this->app->register(\Bixo\Shop\Providers\ActionServiceProvider::class); $this->app->register(\Bixo\Shop\Providers\EventServiceProvider::class); $this->app->register(\Bixo\Shop\Providers\WorkflowServiceProvider::class); } /** * Register the vault facade without the user having to add it to the app.php file. * * @return void */ public function registerFacade() { $this->app->bind('bixo.shop', function($app) { return $this->app->make(Shop::class); }); } /** * Merges user's and shop's configs. * * @return void */ protected function mergeConfig() { $this->mergeConfigFrom( __DIR__ . '/../../config/config.php', 'bixo.shop' ); $this->mergeConfigFrom( __DIR__ . '/../../config/service_kit.php', 'bixo.shop.service_kit' ); $this->mergeConfigFrom( __DIR__ . '/../../config/accessory.php', 'bixo.shop.accessory' ); $this->mergeConfigFrom( __DIR__ . '/../../config/spare_part.php', 'bixo.shop.spare_part' ); } /** * Get the services provided by the provider. * * @return array */ public function provides() { return ['bixo.shop']; } /** * Publish resources. * * @return void */ private function publishResources() { // Publish configuration file $this->publishes([__DIR__ . '/../../config/' => config_path('bixo/shop')], 'config'); // Publish admin view $this->publishes([__DIR__ . '/../../resources/views' => base_path('resources/views/vendor/shop')], 'view'); // Publish language files $this->publishes([__DIR__ . '/../../resources/lang' => base_path('resources/lang/vendor/shop')], 'lang'); // Publish public files and assets. $this->publishes([__DIR__ . '/public/' => public_path('/')], 'public'); } }