Skip to content

Commit 5acde33

Browse files
Merge pull request #323 from N1ebieski/Fix-Inertia-paths-to-views-#17
Fix inertia paths to views
2 parents 92c40a6 + bc09582 commit 5acde33

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ All notable changes to the Laravel extension will be documented in this file.
66

77
- Improve file watcher performance ([#327](https://github.com/laravel/vs-code-extension/pull/327))
88
- Autocompletion, linking, and diagnostics for Storage Disks ([#328](https://github.com/laravel/vs-code-extension/pull/328))
9+
- Fix relative path when path does not exist ([#322](https://github.com/laravel/vs-code-extension/pull/322))
910

1011
## [v1.0.3]
1112

php-templates/inertia.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22

33
echo json_encode([
44
...config('inertia.testing', []),
5-
'page_paths' => collect(config('inertia.testing.page_paths', []))->map(fn($path) => LaravelVsCode::relativePath($path))->toArray(),
5+
'page_paths' => collect(config('inertia.testing.page_paths', []))->flatMap(function($path) {
6+
$relativePath = LaravelVsCode::relativePath($path);
7+
8+
return [$relativePath, mb_strtolower($relativePath)];
9+
})->unique()->values(),
610
]);

src/templates/inertia.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
export default `
33
echo json_encode([
44
...config('inertia.testing', []),
5-
'page_paths' => collect(config('inertia.testing.page_paths', []))->map(fn($path) => LaravelVsCode::relativePath($path))->toArray(),
5+
'page_paths' => collect(config('inertia.testing.page_paths', []))->flatMap(function($path) {
6+
$relativePath = LaravelVsCode::relativePath($path);
7+
8+
return [$relativePath, mb_strtolower($relativePath)];
9+
})->unique()->values(),
610
]);
711
`;

0 commit comments

Comments
 (0)