rap2hpoutre / laravel-credit-card-validator
Laravel credit card validator
Installs: 123 090
Dependents: 0
Suggesters: 0
Security: 0
Stars: 21
Watchers: 5
Forks: 13
Open Issues: 1
Requires
- php: ^7.0
- illuminate/support: 5.* || ^6.0 || ^7.0 || ^8.0
- inacho/php-credit-card-validator: ^1.0
Requires (Dev)
- phpunit/phpunit: ~4.0
README
Adds some minimal validation rules for credit card.
Install
Install via composer
composer require rap2hpoutre/laravel-credit-card-validator
Add Service Provider to config/app.php
in providers
section
Rap2hpoutre\LaravelCreditCardValidator\ServiceProvider::class,
Usage
Add this to your validation rules:
// Add this in your controller method $this->validate($request, [ 'credit-card-number' => 'required|ccn', 'credit-card-date' => 'required|ccd', 'credit-validation-code' => 'required|cvc', ]);