Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

WhisperingWolf's avatar

Laravel redirecting back bug

Hello everyone, Firstly thank you for your time.

I have a really strange bug while working on a laravel project, for some reason sometimes if I click a button to show/edit a record in the page, it looks like the request is happening but after 1-2 seconds the request stops and i get redirected back to the view and I have to click the button again in order for it to send me to other edit view or show view, it doesn't throw any errors in console/network, I did check the laravel log as well there is no bug there, and also I don't have any middleware that does the redirecting.

If you have any idea what the problem might I would be more than welcome to give more information (if needed).

Thank you once again.

0 likes
6 replies
Snapey's avatar

what is happening in the network tab of the browser dev tools should tell you a lot.

1 like
WhisperingWolf's avatar

@Snapey,

Hey, I did try to test it that way, indeed i see something in the network tab but it happens so fast and the page reloads that I cant really look more into it, for example when I try to click the edit button I see the edit with red around (which means it failed) but I cant look into it because the page reloads and it gets lost.

Snapey's avatar

@WhisperingWolf In Chrome at least, you can check the 'preserve log' checkbox.

Get to the point where you are to click edit, then clear the log (no entry symbol), then edit. That POST will be the very first entry in the log. You can click on it and see the headers and the response data.

1 like
WhisperingWolf's avatar

@Snapey Hi,

Sorry for taking this long to reply but sometimes the bug doesn't happened and i still haven't figured out what causes it, I did check the network tab and indeed when i click edit and page reloads (doesn't go to edit) the edit says (cancelled) but there is no information on why it is cancelled, but 1 thing I did see on my npm server is that everytime the bug happens i see a log: [vite] page reload storage/framework/views/e88927a9ebe564c45110dd7a5994859e.php , so i am starting to guess that it has something to do with that.

Vitorado's avatar

Most of the time, it's us who make mistakes. I've had this kind of problem before with Livewire. My advice is to organize your code well to avoid struggling when it bugs.

1 like
JaredF's avatar

We had a similar issue once before and it turned out to be the compiler causing this issue, maybe something worth checking, it might not be the problem but doesn't hurt to look

1 like

Please or to participate in this conversation.