app->register(RouteServiceProvider::class); $this->mergeConfigFrom( module_path('Documentation', 'Config/config.php'), 'documentation', ); } /** * Bootstrap module services. */ public function boot(): void { $this->registerViews(); $this->loadMigrationsFrom(module_path('Documentation', 'Database/Migrations')); } /** * Register module views and anonymous components. */ private function registerViews(): void { $sourcePath = module_path('Documentation', 'Resources/views'); $overridePath = resource_path('views/modules/documentation'); $this->publishes([ $sourcePath => $overridePath, ], ['views', 'documentation-module-views']); $paths = [$sourcePath]; foreach (Config::get('view.paths', []) as $path) { if (is_dir($path . '/modules/documentation')) { array_unshift($paths, $path . '/modules/documentation'); } } $this->loadViewsFrom($paths, 'documentation'); Blade::anonymousComponentPath($sourcePath . '/components', 'documentation'); } }