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->registerSchedule(); $this->registerFacade(); $this->registerBindings(); //$this->registerCommands(); } /** * Register the application bindings. * * @return void */ protected function registerSchedule() { $this->app->bind('schedule', function($app) { return new Schedule($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('Schedule', 'Lavalite\Schedule\Facades\Schedule'); }); } /** * Register bindings for the provider. * * @return void */ public function registerBindings() { // Bind facade $this->app->bind('vidgyor.schedule', function ($app) { return $this->app->make('Vidgyor\Schedule\Schedule'); }); // Bind Schedule to repository $this->app->bind( 'Vidgyor\Schedule\Interfaces\ScheduleRepositoryInterface', \Vidgyor\Schedule\Repositories\Eloquent\ScheduleRepository::class ); $this->app->register(\Vidgyor\Schedule\Providers\AuthServiceProvider::class); $this->app->register(\Vidgyor\Schedule\Providers\RouteServiceProvider::class); } /** * Merges user's and schedule's configs. * * @return void */ protected function mergeConfig() { $this->mergeConfigFrom( __DIR__ . '/../../config/schedule.php', 'schedule' ); } /** * Register scaffolding command */ protected function registerCommands() { if ($this->app->runningInConsole()) { $this->commands([ Commands\MakeSchedule::class, ]); } } /** * Get the services provided by the provider. * * @return array */ public function provides() { return ['vidgyor.schedule']; } /** * Publish resources. * * @return void */ private function publishResources() { // Publish configuration file $this->publishes([__DIR__ . '/../../config/config.php' => config_path('vidgyor/schedule.php')], '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'); } }