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