Laravel 9 post don't redirect back and anywhere (only in inspector but not in the browser)
I'm trying to redirect after process a post, but it doesn't redirect anywhere. I fact I can see the xhr redirect in the chrome inspector, but the app doesn't refresh or redirect.
I have tried with return redirect()->back(), return back(), return redirect()->route('thanks') or many other options but it is always the same. I can see the redirect in inspector, but nothing changes or refresh in the site. The routes, controllers and views are well defined (I can catch the get one on the browser)...
I'm using Laravel 9 with breeze and spark.
What am I missing?
One possible solution could be to check if there are any JavaScript errors preventing the redirect from happening. Another solution could be to try using the with() method to flash a message to the session before redirecting. Here's an example:
return redirect()->route('thanks')->with('message', 'Thank you for submitting!');
Then, in the view that the user is redirected to, you can display the message like this:
I answer myself after Lary "Quickdraw" A.I. suggestion:
I was using a theme that treated "each" form to prefentDefault() and send his own ajax request.