File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77use Illuminate \Support \Str ;
88use Statamic \Console \RunsInPlease ;
99use Statamic \Facades \Form ;
10+ use Statamic \Facades \Path ;
1011
1112use function Laravel \Prompts \confirm ;
1213use function Laravel \Prompts \error ;
@@ -57,6 +58,6 @@ public function handle(): void
5758
5859 protected function getRelativePath ($ path ): string
5960 {
60- return str_replace ( base_path (). ' / ' , '' , $ path );
61+ return Path:: makeRelative ( $ path );
6162 }
6263}
Original file line number Diff line number Diff line change 77use Illuminate \Support \Facades \File ;
88use Illuminate \Support \Str ;
99use Statamic \Console \RunsInPlease ;
10+ use Statamic \Facades \Path ;
1011
1112use function Laravel \Prompts \confirm ;
1213use function Laravel \Prompts \info ;
@@ -33,6 +34,6 @@ public function handle(): void
3334
3435 protected function getRelativePath ($ path ): string
3536 {
36- return str_replace ( base_path (). ' / ' , '' , $ path );
37+ return Path:: makeRelative ( $ path );
3738 }
3839}
Original file line number Diff line number Diff line change 77use Illuminate \Support \Facades \File ;
88use Illuminate \Support \Str ;
99use Statamic \Console \RunsInPlease ;
10+ use Statamic \Facades \Path ;
1011
1112use function Laravel \Prompts \confirm ;
1213use function Laravel \Prompts \info ;
@@ -36,6 +37,6 @@ public function handle(): void
3637
3738 protected function getRelativePath ($ path ): string
3839 {
39- return str_replace ( base_path (). ' / ' , '' , $ path );
40+ return Path:: makeRelative ( $ path );
4041 }
4142}
Original file line number Diff line number Diff line change @@ -19,7 +19,10 @@ public function absoluteViewPath(string $path = ''): string
1919
2020 public function viewPath (string $ view = '' ): string
2121 {
22- return Str::after ($ this ->absoluteViewPath ($ view ), resource_path ('views/ ' ));
22+ return Str::after (
23+ $ this ->absoluteViewPath ($ view ),
24+ Path::tidy (resource_path ('views/ ' ))
25+ );
2326 }
2427
2528 public function themeViewPath (string $ theme , string $ view ): string
You can’t perform that action at this time.
0 commit comments