loadViewsFrom(__DIR__ . '/../../resources/views', 'schedule'); // Load translation $this->loadTranslationsFrom(__DIR__ . '/../../resources/lang', 'schedule'); // 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\Schedule\Providers\AuthServiceProvider::class); $this->app->register(\Bixo\Schedule\Providers\RouteServiceProvider::class); $this->app->register(\Bixo\Schedule\Providers\ActionServiceProvider::class); $this->app->register(\Bixo\Schedule\Providers\EventServiceProvider::class); $this->app->register(\Bixo\Schedule\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.schedule', function($app) { return $this->app->make(Schedule::class); }); } /** * Merges user's and schedule's configs. * * @return void */ protected function mergeConfig() { $this->mergeConfigFrom( __DIR__ . '/../../config/config.php', 'bixo.schedule' ); $this->mergeConfigFrom( __DIR__ . '/../../config/attendee.php', 'bixo.schedule.attendee' ); $this->mergeConfigFrom( __DIR__ . '/../../config/calendar.php', 'bixo.schedule.calendar' ); $this->mergeConfigFrom( __DIR__ . '/../../config/task.php', 'bixo.schedule.task' ); } /** * Get the services provided by the provider. * * @return array */ public function provides() { return ['bixo.schedule']; } /** * Publish resources. * * @return void */ private function publishResources() { // Publish configuration file $this->publishes([__DIR__ . '/../../config/' => config_path('bixo/schedule')], 'config'); // Publish admin view $this->publishes([__DIR__ . '/../../resources/views' => base_path('resources/views/vendor/schedule')], 'view'); // Publish language files $this->publishes([__DIR__ . '/../../resources/lang' => base_path('resources/lang/vendor/schedule')], 'lang'); // Publish public files and assets. $this->publishes([__DIR__ . '/public/' => public_path('/')], 'public'); } }