'required', 'mobile' => 'required', 'new_password' => 'required|min:8|same:confirm_password', 'confirm_password' => 'required', ]; } /** * Get the validation massages that apply to the rules. * * @return array */ public function messages() { return [ ]; } protected function failedValidation(Validator $validator) { if (Request::wantsJson()) { throw new HttpResponseException(response()->json(['message' => $validator->errors()->first(), 'error' => true, 'status' => 422], 422)); } else { throw new ValidationException($validator); } } }