diff --git a/composer.json b/composer.json index 65dc442a5..3dcd002b3 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "illuminate/validation": "^9.21" }, "conflict": { - "laravel/framework": "<9.19.0" + "laravel/framework": "<9.37.0" }, "autoload": { "psr-4": { diff --git a/src/Console/InstallsInertiaStacks.php b/src/Console/InstallsInertiaStacks.php index 9130ddc36..20f3ce53e 100644 --- a/src/Console/InstallsInertiaStacks.php +++ b/src/Console/InstallsInertiaStacks.php @@ -42,6 +42,7 @@ protected function installInertiaVueStack() // Middleware... $this->installMiddlewareAfter('SubstituteBindings::class', '\App\Http\Middleware\HandleInertiaRequests::class'); + $this->installMiddlewareAfter('\App\Http\Middleware\HandleInertiaRequests::class', '\Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets::class'); copy(__DIR__.'/../../stubs/inertia-common/app/Http/Middleware/HandleInertiaRequests.php', app_path('Http/Middleware/HandleInertiaRequests.php')); @@ -153,12 +154,13 @@ protected function installInertiaReactStack() // Middleware... $this->installMiddlewareAfter('SubstituteBindings::class', '\App\Http\Middleware\HandleInertiaRequests::class'); + $this->installMiddlewareAfter('\App\Http\Middleware\HandleInertiaRequests::class', '\Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets::class'); copy(__DIR__.'/../../stubs/inertia-common/app/Http/Middleware/HandleInertiaRequests.php', app_path('Http/Middleware/HandleInertiaRequests.php')); // Views... copy(__DIR__.'/../../stubs/inertia-common/resources/views/app.blade.php', resource_path('views/app.blade.php')); - $this->replaceInFile("@vite('resources/js/app.js')", '@viteReactRefresh'.PHP_EOL." @vite('resources/js/app.jsx')", resource_path('views/app.blade.php')); + $this->replaceInFile("@vite(\"resources/js/Pages/{\$page['component']}.vue\")", '@viteReactRefresh'.PHP_EOL." @vite(\"resources/js/Pages/{\$page['component']}.jsx\")", resource_path('views/app.blade.php')); // Components + Pages... (new Filesystem)->ensureDirectoryExists(resource_path('js/Components')); diff --git a/stubs/inertia-common/resources/views/app.blade.php b/stubs/inertia-common/resources/views/app.blade.php index fe91e9729..b194a264a 100644 --- a/stubs/inertia-common/resources/views/app.blade.php +++ b/stubs/inertia-common/resources/views/app.blade.php @@ -11,7 +11,7 @@ @routes - @vite('resources/js/app.js') + @vite("resources/js/Pages/{$page['component']}.vue") @inertiaHead