fix response of validations

This commit is contained in:
printempw 2016-09-10 21:14:46 +08:00
parent 9ef9137688
commit b455fe6f06
2 changed files with 8 additions and 2 deletions

View File

@ -55,6 +55,10 @@ class Handler extends ExceptionHandler
exit;
}
if ($e instanceof ValidationException) {
return $e->getResponse()->setStatusCode(200);
}
if (config('app.debug')) {
foreach ($this->dontReport as $type) {
if ($e instanceof $type) {

View File

@ -16,7 +16,9 @@ class Controller extends BaseController
*/
protected function formatValidationErrors(Validator $validator)
{
//return $validator->errors()->all();
dd($validator->errors()->all());
return [
'errno' => 1,
'msg' => $validator->errors()->first()
];
}
}