loadViewsFrom(__DIR__ . '/../../resources/views', 'maintenance'); // Load translation $this->loadTranslationsFrom(__DIR__ . '/../../resources/lang', 'maintenance'); // 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->app->register(\Litecms\Maintenance\Providers\AuthServiceProvider::class); $this->app->register(\Litecms\Maintenance\Providers\RouteServiceProvider::class); $this->app->register(\Litecms\Maintenance\Providers\ActionServiceProvider::class); $this->app->register(\Litecms\Maintenance\Providers\EventServiceProvider::class); $this->app->register(\Litecms\Maintenance\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.maintenance', function($app) { return $this->app->make(Maintenance::class); }); } /** * Merges user's and maintenance's configs. * * @return void */ protected function mergeConfig() { $this->mergeConfigFrom( __DIR__ . '/../../config/config.php', 'litecms.maintenance' ); $this->mergeConfigFrom( __DIR__ . '/../../config/vendor.php', 'litecms.maintenance.vendor' ); $this->mergeConfigFrom( __DIR__ . '/../../config/contract.php', 'litecms.maintenance.contract' ); $this->mergeConfigFrom( __DIR__ . '/../../config/workorder.php', 'litecms.maintenance.workorder' ); $this->mergeConfigFrom( __DIR__ . '/../../config/proposal.php', 'litecms.maintenance.proposal' ); } /** * Get the services provided by the provider. * * @return array */ public function provides() { return ['litecms.maintenance']; } /** * Publish resources. * * @return void */ private function publishResources() { // Publish configuration file $this->publishes([__DIR__ . '/../../config/' => config_path('litecms/maintenance')], 'config'); // Publish admin view $this->publishes([__DIR__ . '/../../resources/views' => base_path('resources/views/vendor/maintenance')], 'view'); // Publish language files $this->publishes([__DIR__ . '/../../resources/lang' => base_path('resources/lang/vendor/maintenance')], 'lang'); // Publish public files and assets. $this->publishes([__DIR__ . '/public/' => public_path('/')], 'public'); } }