granitehldg / filament-iban-input
A Filament IBAN input with validation and formatting
Package info
github.com/granitehldg/filament-iban-input
pkg:composer/granitehldg/filament-iban-input
Requires
- php: ^8.2
- ext-bcmath: *
- filament/forms: ^3.0 || ^4.0
- filament/support: ^3.0 || ^4.0
- spatie/laravel-package-tools: ^1.14
Requires (Dev)
- orchestra/testbench: ^10.0
- phpunit/phpunit: ^11.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-09 14:13:01 UTC
README
A Filament form field for IBAN (International Bank Account Number) input with real-time formatting, per-country length validation (ISO 13616), and mod-97 checksum verification.
Features
- Real-time formatting with country code dropdown
- Per-country IBAN length validation (ISO 13616, ~100 countries)
- Mod-97 checksum validation (can be disabled)
- Server-side + client-side (Alpine.js) validation
- Dark mode support, LTR-safe, copy-to-clipboard
- Works with Filament v3 and v4
Requirements
- PHP
^8.2withext-bcmath - Laravel with Filament
^3.0 || ^4.0
Installation
composer require granitehldg/filament-iban-input
The service provider is auto-discovered. No manual registration needed.
Optionally publish the views:
php artisan vendor:publish --tag=filament-iban-input-views
Usage
Basic usage
use Granite\FilamentIban\Forms\Components\IbanInput; IbanInput::make('iban') ->label('Bank Account (IBAN)') ->required();
Limit countries
IbanInput::make('iban') ->countries(['DE', 'FR', 'NL', 'GB']) ->defaultCountry('DE') ->required();
Accept all IBAN countries
By default only ['UA', 'EG', 'DE', 'GB', 'FR', 'NL'] are offered. To accept any known ISO 13616 country:
IbanInput::make('iban') ->allCountries() ->required();
Disable checksum validation
IbanInput::make('iban') ->validateChecksum(false) // format/length only ->required();
Custom lengths
IbanInput::make('iban') ->countries(['ZZ']) ->countryLengths(['ZZ' => 6]) ->validateChecksum(false);
The component stores the complete IBAN as a single string, e.g. DE89370400440532013000.
Helpers
use Granite\FilamentIban\Forms\Components\IbanInput; IbanInput::validateIbanChecksum('DE89370400440532013000'); // true IbanInput::normalize('de89 3704 0044 0532 0130 00'); // DE89370400440532013000
See USAGE_EXAMPLE.md for migrations, models, and advanced validation examples.
Validation
Server-side validation checks, in order:
- Country code is 2 letters and (unless
allCountries()) in the allowed list - Two numeric check digits after the country code
- Body length matches the per-country ISO 13616 length
- Mod-97 checksum equals
1(unless disabled)
Empty values pass through so ->required() / ->nullable() behave as expected.
Testing
composer install vendor/bin/phpunit
Valid IBANs for manual testing:
DE89370400440532013000GB29NWBK60161331926819FR1420041010050500013M02606NL91ABNA0417164300UA213223130000026007233566001
Building assets
npm install npm run build
This compiles resources/css/index.css to resources/dist/filament-iban-input.css. Commit the built file before tagging a release.
Changelog
See CHANGELOG.md for release notes. Follow SemVer: tagged releases (v4.1.0, ...) are what Packagist publishes.
Contributing
Issues and PRs are welcome. Please run tests before submitting.
Security
If you discover a security issue, please email the maintainers privately instead of opening a public issue.
Credits
Developed by Granite Holding.
License
MIT. See LICENSE.