hipsterjazzbo/laravel-luhn-validator
A luhn algorithm validator for Laravel 4's Validator
11,302
3
| Install | |
|---|---|
composer require hipsterjazzbo/laravel-luhn-validator |
|
| Latest Version: | 1.0 |
| PHP: | >=5.4.0 |
| License: | MIT |
| Last Updated: | Jun 26, 2014 |
| Links: | GitHub · Packagist |
Maintainer: HipsterJazzbo
Laravel Luhn Validator
A luhn algorithm validator for Laravel 4's Validator.
Installation
Start by adding this package to your composer.json:
"require-dev": {
"hipsterjazzbo/laravel-luhn-validator": "1.*"
}
Now you've got to update composer:
$ composer update
And then add this package to the ServiceProviders array in your app/config/app.php:
'HipsterJazzbo\LaravelLuhnValidator\LaravelLuhnValidatorServiceProvider'
Usage
Just specify the new rule when you're defining your rules:
$rules = [
'card_number' => [
'required',
'luhn'
]
];