Support the ongoing development of Laravel.io →
posted 9 years ago
Validation
Last updated 2 years ago.
0

If your on the response to the post and you refresh it is going to resubmit, normal behavior. Redirect away to stop a resubmit.

Last updated 2 years ago.
0

Normal behavior? On my common forms i just unsetted $_POST and the problem was gone.

Last updated 2 years ago.
0

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.

Last updated 2 years ago.
0

Yes just redirect back with a status message, or to a new page (also with status message).

return Redirect::back()->withStatus('Form submitted!');
Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Sharping sharping Joined 28 Jun 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.