From 7f00cead78b0bd40c812ac12ed8d46b680aec485 Mon Sep 17 00:00:00 2001 From: Pascal Baljet Date: Thu, 26 Jun 2025 21:15:52 +0200 Subject: [PATCH 1/2] Restore `testing.page_paths` and `testing.page_extensions` configs --- config/inertia.php | 33 +++++++++++++++++++++++++++------ src/ServiceProvider.php | 4 ++-- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/config/inertia.php b/config/inertia.php index f765ac07..6b6b1169 100644 --- a/config/inertia.php +++ b/config/inertia.php @@ -36,9 +36,13 @@ | Pages |-------------------------------------------------------------------------- | - | If you want to ensure that the pages exist, you can set `ensure_pages_exist` to true. - | This will throw an exception if the component does not exist on the filesystem - | when rendering a page. You may configure this separately for testing. + | Set `ensure_pages_exist` to true if you want to enforce that Inertia page + | components exist on disk when rendering a page. This is useful for + | catching missing or misnamed components. + | + | The `page_paths` and `page_extensions` options define where to look + | for page components and which file extensions to consider. + | | */ @@ -71,9 +75,9 @@ | attempts to locate the component as a file relative to any of the | paths AND with any of the extensions specified here. | - | By default, it uses the `page_paths` and `page_extensions` settings - | defined above. You may override these values for testing purposes - | by adding these two keys to this `testing` array. + | Note: In a future release, the `page_paths` and `page_extensions` + | options below will be removed. The root-level options above + | will be used for both application and testing purposes. | */ @@ -81,6 +85,23 @@ 'ensure_pages_exist' => true, + 'page_paths' => [ + + resource_path('js/Pages'), + + ], + + 'page_extensions' => [ + + 'js', + 'jsx', + 'svelte', + 'ts', + 'tsx', + 'vue', + + ], + ], 'history' => [ diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index c3f23f25..28cab930 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -43,8 +43,8 @@ public function register(): void $this->app->bind('inertia.testing.view-finder', function ($app) { return new FileViewFinder( $app['files'], - $app['config']->get('inertia.testing.page_paths', fn () => $app['config']->get('inertia.page_paths')), - $app['config']->get('inertia.testing.page_extensions', fn () => $app['config']->get('inertia.page_extensions')) + $app['config']->get('inertia.testing.page_paths'), + $app['config']->get('inertia.testing.page_extensions') ); }); } From d4909a6322fd78704f70f9d778341ced4448a699 Mon Sep 17 00:00:00 2001 From: Pascal Baljet Date: Thu, 26 Jun 2025 21:21:36 +0200 Subject: [PATCH 2/2] Update inertia.php --- config/inertia.php | 1 - 1 file changed, 1 deletion(-) diff --git a/config/inertia.php b/config/inertia.php index 6b6b1169..fe7141b8 100644 --- a/config/inertia.php +++ b/config/inertia.php @@ -43,7 +43,6 @@ | The `page_paths` and `page_extensions` options define where to look | for page components and which file extensions to consider. | - | */ 'ensure_pages_exist' => false,