Download the PHP package jlorente/laravel-credit-cards without Composer
On this page you can find all versions of the php package jlorente/laravel-credit-cards. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jlorente/laravel-credit-cards
More information about jlorente/laravel-credit-cards
Files in jlorente/laravel-credit-cards
Package laravel-credit-cards
Short Description Laravel >=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.
License BSD-3-Clause
Informations about the package laravel-credit-cards
Laravel Credit Cards
Laravel >=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.
It validates popular brands like Visa, Mastercard, American Express, etc.
Installation
The preferred way to install this extension is through composer.
With Composer installed, you can then install the extension using the following commands:
or add
to the section of your composer.json
file.
Configuration
- Register the ServiceProvider in your config/app.php service provider list.
config/app.php
- Add the following facade to the $aliases section.
config/app.php
-
Publish the package configuration file.
- 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
or in the env configuration by adding a string with array elements separeted by coma.
.env
Usage
CreditCardValidator Facade
You can access a singleton of the CreditCardValidator class through the facade.
To see a complete list of available methods of the package see the PHP Credit Cards documentation.
CreditCardRule
A rule to be use in the laravel validation flow is included in the package.
You can add the rule by using its string form:
or the class form:
Validating security code format
If you provide an integer value as first argument of the rule, the format of the security code (CVC, CVV, etc.) will be validated.
or
Validating the credit card types
You can also provide a list separed by comas of the accepted credit card types. Remember that credit card types should be a subset of the configured system available types.
or
You can also combine credit cards types with security code validation:
or
License
Copyright © 2020 José Lorente Martín [email protected].
Licensed under the BSD 3-Clause License. See LICENSE.txt for details.
All versions of laravel-credit-cards with dependencies
illuminate/support Version >=5.6
jlorente/php-credit-cards Version ^1.0.2