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