Laravel Validation return Json

19:22 Unknown 0 Comments

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

0 comments: