If your on the response to the post and you refresh it is going to resubmit, normal behavior. Redirect away to stop a resubmit.
Normal behavior? On my common forms i just unsetted $_POST and the problem was gone.
Sharping said:
Normal behavior? On my common forms i just unsetted $_POST and the problem was gone.
If you press refresh in a browser it will 'normally' do the last request. If it was a post request then that same post will be resubmitted regardless of whether you unset $_POST (post will be created each request). Thats why when you are finished with a post request you should redirect away to a get request. That way when you press refresh and it will only redo the new redirected get request.
Yes just redirect back with a status message, or to a new page (also with status message).
return Redirect::back()->withStatus('Form submitted!');
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community