Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Commands/MakeComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Illuminate\Support\Str;
use Statamic\Console\RunsInPlease;
use Statamic\Facades\Form;
use Statamic\Facades\Path;

use function Laravel\Prompts\confirm;
use function Laravel\Prompts\error;
Expand Down Expand Up @@ -57,6 +58,6 @@ public function handle(): void

protected function getRelativePath($path): string
{
return str_replace(base_path().'/', '', $path);
return Path::makeRelative($path);
}
}
3 changes: 2 additions & 1 deletion src/Commands/MakeTheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Illuminate\Support\Facades\File;
use Illuminate\Support\Str;
use Statamic\Console\RunsInPlease;
use Statamic\Facades\Path;

use function Laravel\Prompts\confirm;
use function Laravel\Prompts\info;
Expand All @@ -33,6 +34,6 @@ public function handle(): void

protected function getRelativePath($path): string
{
return str_replace(base_path().'/', '', $path);
return Path::makeRelative($path);
}
}
3 changes: 2 additions & 1 deletion src/Commands/MakeView.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Illuminate\Support\Facades\File;
use Illuminate\Support\Str;
use Statamic\Console\RunsInPlease;
use Statamic\Facades\Path;

use function Laravel\Prompts\confirm;
use function Laravel\Prompts\info;
Expand Down Expand Up @@ -36,6 +37,6 @@ public function handle(): void

protected function getRelativePath($path): string
{
return str_replace(base_path().'/', '', $path);
return Path::makeRelative($path);
}
}
5 changes: 4 additions & 1 deletion src/ViewManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ public function absoluteViewPath(string $path = ''): string

public function viewPath(string $view = ''): string
{
return Str::after($this->absoluteViewPath($view), resource_path('views/'));
return Str::after(
$this->absoluteViewPath($view),
Path::tidy(resource_path('views/'))
);
}

public function themeViewPath(string $theme, string $view): string
Expand Down
Loading