You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public function rules() {
$rules = [
'card_number' => ['required', new CardNumber],
'expiry_year' => ['required', new CardExpirationYear($this->get('expiry_month'))],
'expiry_month' => ['required', new CardExpirationMonth($this->get('expiry_year'))],
'cvv' => ['required', new CardCvc($this->get('card_number'))]
];
}
return $rules;
}
public function messages() {
return [
'required' => 'The :attribute field is required',
'card_number.validation.credit_card.card_invalid' => 'Credit card is invalid',
'card_number.validation.credit_card.card_length_invalid' => 'Credit card is invalid'
];
}
public function failedValidation(Validator $validator) {
throw new HttpResponseException(response()->json($validator->errors(), 422));
}
The text was updated successfully, but these errors were encountered:
I can't give custom messages.
public function rules() {
$rules = [
'card_number' => ['required', new CardNumber],
'expiry_year' => ['required', new CardExpirationYear($this->get('expiry_month'))],
'expiry_month' => ['required', new CardExpirationMonth($this->get('expiry_year'))],
'cvv' => ['required', new CardCvc($this->get('card_number'))]
];
}
return $rules;
}
public function messages() {
return [
'required' => 'The :attribute field is required',
'card_number.validation.credit_card.card_invalid' => 'Credit card is invalid',
'card_number.validation.credit_card.card_length_invalid' => 'Credit card is invalid'
];
}
public function failedValidation(Validator $validator) {
throw new HttpResponseException(response()->json($validator->errors(), 422));
}
The text was updated successfully, but these errors were encountered: