Could you use return Inertia::location($url); instead (at least as a workaround)?
I'm referencing https://inertiajs.com/redirects
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm working with this form that submits a store request to create a product, then I'm trying to return and redirect to view the product.
It was working yesterday and today it decided to fail with the below error:
Access to XMLHttpRequest at 'http://user.example.test/my-first-product' (redirected from 'http://example.test/products/create') from origin 'http://example.test' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
I'm using Laravel with InertiaJS and VueJS and I swear the redirect was working yesterday without a problem and today it's not working for some reason. I'm using normal example.test URL flow for the homepage but for viewing the product I'm using subdomains like user.example.text/the-product
this is the redirect line:
public function store(StoreProductRequest $request)
{
// Code
return redirect()->route('products.show', [$user, $product]);
}
This is the route of the redirect:
Route::domain('{user:username}.' . env('APP_URL'))->group(function () {
Route::get('{product:slug}', [ProductController::class, 'show'])->name('products.show');
});
Product show:
public function show(User $user, Product $product)
{
return Inertia::render('Products/Show', [
'user' => $user,
'product' => $product,
'thumbnails' => $product->productimages
]);
}
I looked everywhere for a solution but all what I found 4 5 years old solutions with installing packages to solve the issue while I'm 100% confident that it was working yesterday without packages, I tried to chase any changes I made but nothing related to the issue.
Please or to participate in this conversation.