@@ -212,23 +212,21 @@ protected function registerModuleMacros(): void
212212 $ relativeNamespace = trim ($ relativeNamespace , '\\' );
213213 $ studlyName = $ this ->getStudlyName ();
214214
215- return trim ("{$ base }\\{$ studlyName }\\{$ relativeNamespace }" , '\\' );
215+ return str ($ base )->append ('\\' )->append ($ studlyName )->append ('\\' )->append ($ relativeNamespace )->replace ('\\\\' , '\\' )->toString ();
216+ // return trim("{$base}\\{$studlyName}\\{$relativeNamespace}", '\\');
216217 });
217218
218219 Module::macro ('getTitle ' , function () {
219220 return str ($ this ->getStudlyName ())->kebab ()->title ()->replace ('- ' , ' ' )->toString ();
220221 });
221222
222223 Module::macro ('appNamespace ' , function (string $ relativeNamespace = '' ) {
223- $ prefix = str (config ('modules.paths.app_folder ' , 'app ' ))->ltrim (DIRECTORY_SEPARATOR , '\\' )->studly ();
224+ $ prefix = str (config ('modules.paths.app_folder ' , 'app ' ))->ltrim (DIRECTORY_SEPARATOR , '\\' )->studly ()-> toString () ;
224225 $ relativeNamespace = trim ($ relativeNamespace , '\\' );
225- if ($ prefix != '' ) {
226+ if (filled ( $ prefix) ) {
226227 $ relativeNamespace = str_replace ($ prefix . '\\' , '' , $ relativeNamespace );
227228 $ relativeNamespace = str_replace ($ prefix , '' , $ relativeNamespace );
228229 }
229- $ relativeNamespace = trim ($ relativeNamespace , '\\' );
230- $ relativeNamespace = '\\' . $ relativeNamespace ;
231-
232230 return $ this ->namespace ($ relativeNamespace );
233231 });
234232 Module::macro ('appPath ' , function (string $ relativePath = '' ) {
0 commit comments