Validation method to detect redirect->withInput() from a failed validation->run() |
If you are processing HTML forms using the Post / Redirect / Get pattern (as everyone should - read this and this) it can be handy to know if we arrived at some point because field validation failed in a form's action method.
For instance, consider a form for updating an existing "user". If this is the "first time" to this form we will populate the fields from the database otherwise we repopulate using "old" data. Here's one idea on how to implement what I'm asking for. PHP Code: |
Welcome Guest, Not a member yet? Register Sign In |