Open kennaar opened 5 years ago
That's a good point. And it takes a response, which we need, and it's handled well.
It's not a bug, but definitely an improvement. You want to make a PR? If so, don't forget about the tests: it_can_automatically_redirect_back_when_failing_verification
and it_can_automatically_redirect_to_a_specified_destination_when_failing_verification
.
Just be sure that all recent Laravel versions still work, since Laravel introduces breaking changes in minor releases. If ValidationException
only exists since 5.7 (I've no idea), we need a HttpResponseException
fallback.
Why does this package throw a
Illuminate\Http\Exceptions\HttpResponseException
when form validation fails? Laravel form request classes throw aIlluminate\Validation\ValidationException
. Wouldn't it be better to throw that one instead to stay inline with the "defaul" laravel way?