setModuleAlias(); $this->setModulePath(); $this->registerTranslations(); $this->registerConfig(); $this->registerViews(); } /** * Register config. * @return void */ protected function registerConfig() { $this->publishes([$this->path . '/../Config/config.php' => config_path($this->alias . '.php')]); $this->mergeConfigFrom($this->path . '/../Config/config.php', $this->alias); } public function register() { } /** * Register views. * @return void */ protected function registerViews() { $viewPath = base_path('resources/views/modules/' . $this->alias); $sourcePath = $this->path . '/../Resources/views'; $this->loadViewsFrom(array_merge(array_map(function ($path) { return $path . '/modules/' . $this->alias; }, \Config::get('view.paths')), [$sourcePath]), $this->alias); if (is_dir($sourcePath) && $this->publishViews) { $this->publishes([$sourcePath => $viewPath], 'module-views'); } } /** * Register translations. * @return void */ protected function registerTranslations() { $this->loadTranslationsFrom($this->path . '/../Resources/lang', $this->alias); } }