Laravel Validation required keep throw exception the given data invalid.

My Laravel Project happen something strange that, basic Laravel Validation for Required Rule not working correctly. It really drives me crazy…
It keeps throwing the below error:-
Illuminate \ Validation \ ValidationException
The given data was invalid.
Finally I found out it is due to I implemented the new Laravel Whoops with IDE Integration.
I use below code.
https://gist.github.com/adampatterson/1c01aec54ebce7632bddd9e9e8566a65#file-sample-php
In my app/Exceptions/Handler.php
the render() method.
if (config('app.debug') && app()->environment() != 'production') {
    return $this->handleWhoopsies($request, $exception);
}
At this moment I just remove the support for the IDE. Keep thing simple.

Leave a Reply

Your email address will not be published. Required fields are marked *