laravel-validation-rules / credit-card

Credit Card Validation
https://laravel-validation-rules.github.io/
Apache License 2.0
227 stars 69 forks source link

How to customize validation message from Form Request ? #11

Closed styvesamson closed 6 years ago

styvesamson commented 6 years ago

<?php

namespace App\Shop\Checkout\Requests;

use App\Shop\Base\BaseFormRequest; use LVR\CreditCard\CardCvc; use LVR\CreditCard\CardNumber; use LVR\CreditCard\CardExpirationDate;

class CreditCardRequest extends BaseFormRequest { /**

DarkaOnLine commented 6 years ago

Just translate validation.credit_card.card_checksum_invalid like you like.

zakir1929 commented 1 year ago

add this code into any of your service provider boot method

Validator::replacer('cs_captcha_validate', function($message, $attribute, $rule, $parameters) {
            return sprintf('Recaptcha Invalid', $attribute);
}); 
    here cs_captcha_validate is the input field