loadViewsFrom(__DIR__ . '/../../resources/views', 'kitchen_blog'); // Load translation $this->loadTranslationsFrom(__DIR__ . '/../../resources/lang', 'kitchen_blog'); // 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->registerKitchenBlog(); $this->registerFacade(); $this->registerBindings(); //$this->registerCommands(); } /** * Register the application bindings. * * @return void */ protected function registerKitchenBlog() { $this->app->bind('kitchen_blog', function($app) { return new KitchenBlog($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('KitchenBlog', 'Lavalite\KitchenBlog\Facades\KitchenBlog'); }); } /** * Register bindings for the provider. * * @return void */ public function registerBindings() { // Bind facade $this->app->bind('litecms.kitchen_blog', function ($app) { return $this->app->make('Litecms\KitchenBlog\KitchenBlog'); }); // Bind Kitchen to repository $this->app->bind( 'Litecms\KitchenBlog\Interfaces\KitchenRepositoryInterface', \Litecms\KitchenBlog\Repositories\Eloquent\KitchenRepository::class ); // Bind KitchenCategory to repository $this->app->bind( 'Litecms\KitchenBlog\Interfaces\KitchenCategoryRepositoryInterface', \Litecms\KitchenBlog\Repositories\Eloquent\KitchenCategoryRepository::class ); // Bind KitchenComment to repository $this->app->bind( 'Litecms\KitchenBlog\Interfaces\KitchenCommentRepositoryInterface', \Litecms\KitchenBlog\Repositories\Eloquent\KitchenCommentRepository::class ); // Bind KitchenTag to repository $this->app->bind( 'Litecms\KitchenBlog\Interfaces\KitchenTagRepositoryInterface', \Litecms\KitchenBlog\Repositories\Eloquent\KitchenTagRepository::class ); $this->app->register(\Litecms\KitchenBlog\Providers\AuthServiceProvider::class); $this->app->register(\Litecms\KitchenBlog\Providers\EventServiceProvider::class); $this->app->register(\Litecms\KitchenBlog\Providers\RouteServiceProvider::class); // $this->app->register(\Litecms\KitchenBlog\Providers\WorkflowServiceProvider::class); } /** * Merges user's and kitchen_blog's configs. * * @return void */ protected function mergeConfig() { $this->mergeConfigFrom( __DIR__ . '/../../config/config.php', 'litecms.kitchen_blog' ); } /** * Register scaffolding command */ protected function registerCommands() { if ($this->app->runningInConsole()) { $this->commands([ Commands\MakeKitchenBlog::class, ]); } } /** * Get the services provided by the provider. * * @return array */ public function provides() { return ['litecms.kitchen_blog']; } /** * Publish resources. * * @return void */ private function publishResources() { // Publish configuration file $this->publishes([__DIR__ . '/../../config/config.php' => config_path('litecms/kitchen_blog.php')], 'config'); // Publish admin view $this->publishes([__DIR__ . '/../../resources/views' => base_path('resources/views/vendor/kitchen_blog')], 'view'); // Publish language files $this->publishes([__DIR__ . '/../../resources/lang' => base_path('resources/lang/vendor/kitchen_blog')], 'lang'); // Publish public files and assets. $this->publishes([__DIR__ . '/public/' => public_path('/')], 'public'); } }