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