File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,10 @@ public function getModule(string $name): \Nwidart\Modules\Module
1919 public function convertPathToNamespace (string $ fullPath ): string
2020 {
2121 $ appFolder = trim (config ('modules.paths.app_folder ' , 'app ' ), '/ \\' );
22+ $ appPath = $ appFolder . DIRECTORY_SEPARATOR ;
2223 $ base = str (trim (config ('modules.paths.modules ' , base_path ('Modules ' )), '/ \\' ));
23- $ relative = str ($ fullPath )->afterLast ($ base )->replaceFirst (DIRECTORY_SEPARATOR . $ appFolder . DIRECTORY_SEPARATOR , DIRECTORY_SEPARATOR );
24+ $ replacementPath = str_replace (DIRECTORY_SEPARATOR .DIRECTORY_SEPARATOR , '/ ' , DIRECTORY_SEPARATOR . $ appPath );
25+ $ relative = str ($ fullPath )->afterLast ($ base )->replaceFirst ($ replacementPath , DIRECTORY_SEPARATOR );
2426
2527 return str ($ relative )
2628 ->ltrim ('/ \\' )
Original file line number Diff line number Diff line change @@ -45,7 +45,9 @@ protected function getModulePlugins(): array
4545 }
4646 // get a glob of all Filament plugins
4747 $ basePath = str (config ('modules.paths.modules ' , 'Modules ' ));
48- $ pattern = $ basePath . DIRECTORY_SEPARATOR . '* ' . DIRECTORY_SEPARATOR . 'app ' . DIRECTORY_SEPARATOR . 'Filament ' . DIRECTORY_SEPARATOR . '*Plugin.php ' ;
48+ $ appFolder = trim (config ('modules.paths.app_folder ' , 'app ' ), '/ \\' );
49+ $ appPath = $ appFolder . DIRECTORY_SEPARATOR ;
50+ $ pattern = $ basePath . DIRECTORY_SEPARATOR . '* ' . DIRECTORY_SEPARATOR . $ appPath . 'Filament ' . DIRECTORY_SEPARATOR . '*Plugin.php ' ;
4951 $ pluginPaths = glob ($ pattern );
5052
5153 return collect ($ pluginPaths )->map (fn ($ path ) => FilamentModules::convertPathToNamespace ($ path ))->toArray ();
You can’t perform that action at this time.
0 commit comments