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