laravel-validation-rules/credit-card
Laravel validation rules for credit cards: validate card numbers with Luhn, detect major brands, and check expiration dates and CVV codes. Drop-in rules for form requests and validators, with clear error messages and support for common card types.
false) instead of throwing a TypeError when it receives non-string input (e.g., integers, arrays, nulls from JSON payloads or form-encoded bodies). This turns a potential 500 error into a normal validation error, which is a direct reliability win for any checkout, billing, or payment-method-capture flow.Adopt or keep this package when:
Look elsewhere or build in-house when:
For executives: The team uses a small, well-scoped open-source library to validate credit-card numbers at the edge of our payment flows. Release 1.12.3 is a one-line defensive fix: malformed input (for example, a numeric card field sent as a JSON number instead of a string) now produces a normal "invalid input" response instead of a server error. Net effect: fewer 500 errors, cleaner error messages for customers, and no changes required on our side. No new cost, no migration, no breaking changes.
For engineering: 1.12.3 fixes a TypeError thrown when the rule received non-string input; it now fails validation instead. This is a safe, non-breaking patch — no API or rule-signature changes, so it can be adopted by bumping the version constraint. Worth pairing with a quick check that our form requests and API validation paths expect a 422 rather than a caught exception for malformed card fields, and worth adding a test case covering non-string input to lock in the behavior.
Recommendation: Adopt 1.12.3 as a routine patch update; keep the package as the validation layer, and ensure gateway/tokenization concerns remain with the payment provider SDK.
How can I help you explore Laravel packages today?