Skip to content

Commit

Permalink
Update Module AppServiceProvider Stub (phpvms#1811)
Browse files Browse the repository at this point in the history
Co-authored-by: Nabeel S <[email protected]>
  • Loading branch information
arthurpar06 and nabeelio authored May 24, 2024
1 parent 36f79e7 commit 84ecc61
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions resources/stubs/modules/provider.stub
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,14 @@ class AppServiceProvider extends ServiceProvider

$this->publishes([$sourcePath => $viewPath],'views');

$this->loadViewsFrom(array_merge(array_map(function ($path) {
return $path . '/modules/$LOWER_NAME$';
}, \Config::get('view.paths')), [$sourcePath]), '$LOWER_NAME$');
$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$');
}

/**
Expand Down

0 comments on commit 84ecc61

Please sign in to comment.