- Can I use makinacorpus/iban-bundle in a Laravel application?
- No. It is a Symfony bundle that depends on Symfony's bundle kernel, dependency injection container, Form component, and Validator integration, none of which exist in Laravel's request lifecycle. Laravel uses Symfony components internally but has no bundle registration or Symfony Form types. For Laravel, implement IBAN validation as a custom ValidationRule or use a maintained standalone PHP IBAN validator behind a thin rule.
- How do I install and configure makinacorpus/iban-bundle?
- In a Symfony app you install it with Composer, typically composer require makinacorpus/iban-bundle, and Symfony Flex auto-registers the bundle. Configuration is minimal: you enable the validator and service through bundle config. This workflow does not apply to Laravel, where Composer install alone will not wire the bundle into the framework.
- What does the IBAN validator constraint actually check?
- It validates the ISO 13616 structure, including character set, country-specific length, and the mod-97 checksum, by wrapping the makinacorpus/iban library. It returns detailed validation results for invalid IBANs rather than a simple boolean. In Symfony you can apply it to form fields and Doctrine entity properties.
- Is makinacorpus/iban-bundle maintained and safe for production?
- The signals are weak: roughly 4 stars, 0 dependents, a composite score of 0.02, and Symfony-only scope. Country IBAN tables drift as SEPA members amend formats, so an unsupported table becomes a silent correctness bug that can accept invalid IBANs or reject valid ones. Treat it as a reference implementation unless IBAN capture is a soft UX nicety rather than a payments critical path.
- What Laravel validation rule should I use for IBAN instead?
- Implement a custom ValidationRule that normalises input by stripping whitespace and uppercasing, then checks the country length table, character set, and mod-97 checksum. Pair it with a small Iban value object so stored values are canonical. Source the country table from a maintained dataset rather than copying a stale table by hand.
- Which Symfony and PHP versions does makinacorpus/iban-bundle support?
- The bundle targets Symfony's bundle, DI, Form, and Validator stack and carries its own Symfony version pins and PHP floor. Those constraints frequently conflict with modern dependency graphs, especially since Laravel pins its internal Symfony component versions. Check the composer.json platform requirements before attempting any install and avoid platform-req overrides in production.
- Can I reuse the IBAN validation logic from the bundle without installing it?
- Yes. The durable asset is the ISO 13616 logic, which is small, static, and auditable: character set, country-length table, and mod-97 checksum. Read the bundle as a reference implementation and reimplement the rules as a Laravel ValidationRule plus an Iban value object. If you must reuse code, vendor the specific validator file with attribution and a pinned commit, accepting fork maintenance.
- How do I test IBAN validation in Laravel?
- Use table-driven tests with known-valid and known-invalid IBANs per country, covering lowercase input, embedded spaces, and wrong-length country formats. Assert that normalisation produces canonical uppercase, space-free values before validation. Include mod-97 failure cases and at least one country whose format has changed recently to catch table drift.
- Does makinacorpus/iban-bundle support form validation and Doctrine entities?
- Yes, within Symfony: it provides a validator constraint usable on form fields and Doctrine entity assertions, plus an injectable IBAN validation service. It also returns detailed validation results for invalid IBANs. None of this transfers to Laravel's Form Request and validation system, where you would need an equivalent rule and request class.
- What are alternatives to makinacorpus/iban-bundle for Laravel?
- Use a maintained standalone PHP IBAN validator behind a thin Laravel ValidationRule, or write your own rule from the ISO 13616 specification. The bundle's headline Symfony Form type feature is irrelevant if you only need server-side validation. Prefer alternatives with an actively updated country table and clear ownership over the bundle's stale Symfony-only scope.