loadViewsFrom(__DIR__ . '/../../resources/views', 'project_manager'); // Load translation $this->loadTranslationsFrom(__DIR__ . '/../../resources/lang', 'project_manager'); // 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->registerCommands(); $this->app->register(\ProjectManagers\ProjectManager\Providers\AuthServiceProvider::class); $this->app->register(\ProjectManagers\ProjectManager\Providers\RouteServiceProvider::class); // $this->app->register(\ProjectManagers\ProjectManager\Providers\EventServiceProvider::class); // $this->app->register(\ProjectManagers\ProjectManager\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('project_managers.project_manager', function($app) { return $this->app->make(ProjectManagers::class); }); } /** * Merges user's and project_manager's configs. * * @return void */ protected function mergeConfig() { $this->mergeConfigFrom( __DIR__ . '/../../config/config.php', 'project_managers.project_manager' ); $this->mergeConfigFrom( __DIR__ . '/../../config/manager.php', 'project_managers.project_manager.manager' ); } /** * Register scaffolding command */ protected function registerCommands() { if ($this->app->runningInConsole()) { $this->commands([ \ProjectManagers\ProjectManager\Commands\ProjectManager::class, ]); } } /** * Get the services provided by the provider. * * @return array */ public function provides() { return ['project_managers.project_manager']; } /** * Publish resources. * * @return void */ private function publishResources() { // Publish configuration file $this->publishes([__DIR__ . '/../../config/' => config_path('project_managers/project_manager')], 'config'); // Publish admin view $this->publishes([__DIR__ . '/../../resources/views' => base_path('resources/views/vendor/project_manager')], 'view'); // Publish language files $this->publishes([__DIR__ . '/../../resources/lang' => base_path('resources/lang/vendor/project_manager')], 'lang'); // Publish public files and assets. $this->publishes([__DIR__ . '/public/' => public_path('/')], 'public'); } }