validator = $validator; } public function render() { $response = new BaseResponse(); $response->setMessage($this->validator->errors()->first()); $response->setStatus("KO"); return response()->json($response, $this->code); } }