PHPackages                             jlorente/laravel-credit-cards - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. jlorente/laravel-credit-cards

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

jlorente/laravel-credit-cards
=============================

Laravel &gt;=5.6 integration for the PHP Credit Cards package that allows to perform operations on debit and credit cards like format, validate brand, number and Luhn algorithm.

1.0.3(2y ago)737.5k↓42.9%3BSD-3-ClausePHPPHP &gt;=7.0.0

Since Sep 26Pushed 2y ago1 watchersCompare

[ Source](https://github.com/jlorente/laravel-credit-cards)[ Packagist](https://packagist.org/packages/jlorente/laravel-credit-cards)[ RSS](/packages/jlorente-laravel-credit-cards/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (4)Dependencies (4)Versions (5)Used By (0)

Laravel Credit Cards
====================

[](#laravel-credit-cards)

Laravel &gt;=5.6 integration for the [PHP Credit Cards package](https://github.com/jlorente/php-credit-cards)that allows to perform operations on debit and credit cards like format, validate brand, number and Luhn algorithm.

It validates popular brands like Visa, Mastercard, American Express, etc.

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

With Composer installed, you can then install the extension using the following commands:

```
$ php composer.phar require jlorente/laravel-credit-cards
```

or add

```
...
    "require": {
        "jlorente/laravel-credit-cards": "*"
    }
```

to the `require` section of your `composer.json` file.

Configuration
-------------

[](#configuration)

1. Register the ServiceProvider in your config/app.php service provider list.

config/app.php

```
return [
    //other stuff
    'providers' => [
        //other stuff
        \Jlorente\Laravel\CreditCards\CreditCardsServiceProvider::class,
    ];
];
```

2. Add the following facade to the $aliases section.

config/app.php

```
return [
    //other stuff
    'aliases' => [
        //other stuff
        'CreditCardValidator' => \Jlorente\Laravel\CreditCards\Facades\CreditCardValidator::class,
    ];
];
```

3. Publish the package configuration file.

```
$ php artisan vendor:publish --provider='Jlorente\Laravel\CreditCards\CreditCardsServiceProvider'
```

4. If you want to limit the available credit card types in your system, you can use the credit\_cards.php configuration file to specify them.

config/credit\_cards.php

```
