Skip to content

Commit 0b2acfe

Browse files
committed
simplify inertia script
1 parent 2739be0 commit 0b2acfe

File tree

2 files changed

+8
-18
lines changed

2 files changed

+8
-18
lines changed

php-templates/inertia.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
<?php
22

3-
$config = config('inertia.testing', []);
4-
5-
$pagePaths = collect($config['page_paths'] ?? [])->map(function($path) {
6-
return LaravelVsCode::relativePath($path);
7-
});
8-
9-
$config['page_paths'] = $pagePaths->toArray();
10-
11-
echo json_encode($config);
3+
echo json_encode([
4+
...config('inertia.testing', []),
5+
'page_paths' => collect(config('inertia.testing.page_paths', []))->map(fn($path) => LaravelVsCode::relativePath($path))->toArray(),
6+
]);

src/templates/inertia.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
// This file was generated from php-templates/inertia.php, do not edit directly
22
export default `
3-
$config = config('inertia.testing', []);
4-
5-
$pagePaths = collect($config['page_paths'] ?? [])->map(function($path) {
6-
return LaravelVsCode::relativePath($path);
7-
});
8-
9-
$config['page_paths'] = $pagePaths->toArray();
10-
11-
echo json_encode($config);
3+
echo json_encode([
4+
...config('inertia.testing', []),
5+
'page_paths' => collect(config('inertia.testing.page_paths', []))->map(fn($path) => LaravelVsCode::relativePath($path))->toArray(),
6+
]);
127
`;

0 commit comments

Comments
 (0)