rap2hpoutre/laravel-credit-card-validator

Laravel credit card validator

v1.0.0 2020-10-27 06:49 UTC

This package is auto-updated.

Last update: 2024-10-27 15:44:00 UTC


README

Packagist Software License Build Status Quality Score SensioLabsInsight

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',
]);