Answer the question
In order to leave comments, you need to log in
How to throw different errors on tokenMismatchException?
Found an interesting way to catch this exception. I wanted to process it by throwing it on login, because it usually pops up when it gets cold. But if you poke for a long time on the submit form, so that the token does not have time to get into shape, I mean, it did not have time to load. How can I issue a different error in this situation?:
Answer the question
In order to leave comments, you need to log in
If the token did not have time to load into the form (it’s hard to believe in this, to be honest), it means that a request came to the server in which there is no token at all. So check this fact in App\Http\MiddlewareVerifyCsrfToken
.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question