rap2hpoutre/laravel-credit-card-validator
Laravel validator rule for credit card numbers that checks card validity and detects the brand (Visa, Mastercard, Amex, and more). Drop it into validation rules to verify cards with Luhn checks and type detection.
Consider it when:
credit_card rule with no configuration.Look elsewhere when:
Executives: This is a tiny, low-cost validation aid that catches obvious card-number typos before they reach the payment provider. It can improve checkout completion and reduce avoidable declines, but it is not a security, compliance, or fraud control. Given its age and small community footprint, treat adoption as a time-boxed experiment or a pattern to replicate internally—not a strategic dependency.
Engineering: The package is a thin Laravel validation rule using the Luhn algorithm with optional card-type checks. The code surface is small and easy to vendor or fork under MIT. The main risks are compatibility with current Laravel/PHP versions and stale card-brand logic. Validate in a spike, pin the version, and keep the payment provider as the source of truth. If compatibility is uncertain, a small internal rule with tests is likely cheaper and safer than adopting the dependency.
How can I help you explore Laravel packages today?