Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Credit Card Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Input-hardening / reliability decisions: The 1.12.3 patch makes the credit-card validation rule fail validation (return 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.
  • Build vs. buy for validation logic: Card-number validation (Luhn check, brand detection, formatting rules) is commodity logic. This package is a thin, focused dependency that lets the team avoid maintaining bespoke regex/Luhn code — a low-cost buy decision.
  • Scope/roadmap signal: A maintenance release of this kind (a single defensive fix, no new features, no API changes) signals the package is in a stable, low-churn state. That's a positive signal for "keep as-is" on the roadmap and argues against a migration or in-house rewrite.
  • API contract decisions for public/internal endpoints: Because malformed input now produces a standard validation failure rather than an exception, API error-response design can rely on a uniform 422 validation shape, simplifying client-side error handling and support playbooks.

When to Consider This Package

Adopt or keep this package when:

  • You need server-side credit-card number validation in Laravel form requests or validators and want a conventional rule rather than hand-rolled Luhn logic.
  • Your validation inputs can arrive from untrusted or loosely typed sources — JSON APIs, mobile clients, third-party webhooks — where 1.12.3's non-string handling prevents 500s.
  • You want a small, single-purpose dependency with no runtime service calls (no external API, no PCI-scope expansion beyond validation).
  • You are on a Laravel version the package supports and value a low-maintenance dependency.

Look elsewhere or build in-house when:

  • You need full payment-method handling — tokenization, vaulting, BIN lookup, 3-D Secure, or gateway integration. This package validates format only; use a payment provider SDK (Stripe, Adyen, Braintree) for those flows.
  • You require active feature development (e.g., new card brands, configurable rules). Release cadence here is maintenance-oriented.
  • You need strict typing guarantees and would rather have hard failures surfaced as exceptions in your own code path; note that this release deliberately changes that behavior for non-string input.

How to Pitch It (Stakeholders)

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox