Laravel Validation return Json
$validator = Validator::make($data = $request->all(),User::$rules);
if ($validator->fails())
{
return response()->Json(array('errors'=>$validator->errors()->toArray()));
}
if ($validator->fails())
{
return response()->Json(array('errors'=>$validator->errors()->toArray()));
}
0 comments: