| Q | A
| ----------------- | ---
| Bug? | yes
| New Feature? | no
| Framework | Larave
| Framework version | 5.5.*
| Package version | 2.0.0-alpha1
| PHP version | 7.1.10
When using FormRequest to validate input given by client, and validation fails, it simply returns:
"message": "The given data was invalid.",
Along with status_code 500 + debug trace.
I would expect it to give some more clues as to which validations that failed, and why.
Solution, in your FormRequest use
use Dingo\Api\Http\FormRequest;
Instead of
use Illuminate\Foundation\Http\FormRequest;
Sitting in the same boat, tried to do abstract class Form extends \Dingo\ApiHttpFormRequest, what error should be thrown?
Tried: $this->throwValidationException(request(), $validator) and: $this->failedValidation($validator)
But the status code is still 500
Indeed this should most definitely not be a 500
Closing, PR was merged.
Most helpful comment
1519