How can I establish whether controller method was hit from a redirect

Posted 1 year ago by longestdrive

Hi I'm validating a form using a form request which as you would expect returns to the form following a failed validation and has $errors available in the view.

However in my controller method which creates the view etc my method empties a cart before the view is created (in case of any orphaned data etc from a cancelled request).

I'd like to be able to check - before this empty method is called - whether the method is being called as a result of a redirect.

I thought about adding a value to the redirect but as this is being handled by the form request I'm not sure how to go about this

Any suggestions?


Please sign in or create an account to participate in this conversation.