New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

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
Laravel:4
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'
    ]
];

Learn more about Laravel validation

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

648,266,899 9,701
laravel/framework

The Laravel Framework.

604,216,237 34,982
laravel/tinker

Powerful REPL for the Laravel framework.

512,508,631 7,443
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

429,221,767 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

407,699,310 4,663

Version History

Version Released PHP Laravel License
1.0 >=5.4.0 4.2.* MIT