diff --git a/resources/stubs/modules/provider.stub b/resources/stubs/modules/provider.stub index 1a20d9d6d..ca80610e0 100644 --- a/resources/stubs/modules/provider.stub +++ b/resources/stubs/modules/provider.stub @@ -68,18 +68,13 @@ class AppServiceProvider extends ServiceProvider public function registerViews() { $viewPath = resource_path('views/modules/$LOWER_NAME$'); - $sourcePath = __DIR__.'/../Resources/views'; + $sourcePath = __DIR__ . '/../Resources/views'; - $this->publishes([$sourcePath => $viewPath],'views'); + $this->publishes([$sourcePath => $viewPath,], 'views'); - $this->loadViewsFrom(array_merge(array_filter(array_map(function ($path) { - $path = str_replace('default', setting('general.theme'), $path); - // Check if the directory exists before adding it - if (file_exists($path.'/modules/$LOWER_NAME$') && is_dir($path.'/modules/$LOWER_NAME$')) - return $path.'/modules/$LOWER_NAME$'; - - return null; - }, \Config::get('view.paths'))), [$sourcePath]), '$LOWER_NAME$'); + $this->loadViewsFrom(array_merge(array_map(function ($path) { + return str_replace('default', setting('general.theme'), $path) . '/modules/$LOWER_NAME$'; + }, \Config::get('view.paths')), [$sourcePath]), '$LOWER_NAME$'); } /**