loadViewsFrom(__DIR__ . '/../../resources/views', 'raisen'); // Load translation $this->loadTranslationsFrom(__DIR__ . '/../../resources/lang', 'raisen'); // 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->registerRaisen(); $this->registerFacade(); $this->registerBindings(); //$this->registerCommands(); } /** * Register the application bindings. * * @return void */ protected function registerRaisen() { $this->app->bind('raisen', function($app) { return new Raisen($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('Raisen', 'Lavalite\Raisen\Facades\Raisen'); }); } /** * Register bindings for the provider. * * @return void */ public function registerBindings() { // Bind facade $this->app->bind('beegees.raisen', function ($app) { return $this->app->make('Beegees\Raisen\Raisen'); }); // Bind Office to repository $this->app->bind( 'Beegees\Raisen\Interfaces\OfficeRepositoryInterface', \Beegees\Raisen\Repositories\Eloquent\OfficeRepository::class ); $this->app->register(\Beegees\Raisen\Providers\AuthServiceProvider::class); $this->app->register(\Beegees\Raisen\Providers\RouteServiceProvider::class); } /** * Merges user's and raisen's configs. * * @return void */ protected function mergeConfig() { $this->mergeConfigFrom( __DIR__ . '/../../config/config.php', 'beegees.raisen' ); } /** * Register scaffolding command */ protected function registerCommands() { if ($this->app->runningInConsole()) { $this->commands([ Commands\MakeRaisen::class, ]); } } /** * Get the services provided by the provider. * * @return array */ public function provides() { return ['beegees.raisen']; } /** * Publish resources. * * @return void */ private function publishResources() { // Publish configuration file $this->publishes([__DIR__ . '/../../config/config.php' => config_path('beegees/raisen.php')], 'config'); // Publish admin view $this->publishes([__DIR__ . '/../../resources/views' => base_path('resources/views/vendor/raisen')], 'view'); // Publish language files $this->publishes([__DIR__ . '/../../resources/lang' => base_path('resources/lang/vendor/raisen')], 'lang'); // Publish public files and assets. $this->publishes([__DIR__ . '/public/' => public_path('/')], 'public'); } }