Weave Code
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
Czech Bank Account

Czech Bank Account Laravel Package

czechphp/czech-bank-account

Utilities to validate and work with Czech bank payment identifiers in PHP: bank account numbers, bank codes, variable/specific/constant symbols. Includes a filesystem loader for Czech payment system bank code data. Composer-installable package.

View on GitHub
Deep Wiki
Context7

At a glance

Frequently asked questions about Czech Bank Account
How do I install and use this package in a Laravel project?
Run `composer require czechphp/czech-bank-account` to install. Register the validator in `AppServiceProvider` as a singleton, then inject or facade it into your services. Example: `BankAccount::validate('CZ12345678900000000000')` for IBAN validation.
Does this package support both IBAN and Czech domestic account formats?
Yes, it validates both IBAN (e.g., `CZ12345678900000000000`) and domestic formats (e.g., `1234567890/0100`). Use the `BankAccountNumberValidator` for general checks or specialized validators like `BankCodeValidator` for bank-specific codes.
What Laravel versions and PHP requirements does this package support?
The package requires PHP 8.1+, which aligns with Laravel 9+. For Laravel 8.x, ensure PHP 8.1 compatibility is met. Test thoroughly if using older versions, as some features may rely on newer PHP syntax.
How can I validate variable symbols (e.g., for bank transfers)?
Use the `VariableSymbolValidator` class. Example: `$validator = new VariableSymbolValidator(); $validator->validate('123')` returns `ERROR_NONE` if valid. For constant symbols, use `ConstantSymbolValidator` with formats like `0006`.
Is there a way to load bank codes dynamically (e.g., from a database)?
The package uses a `LoaderInterface` for bank codes. Implement your own loader (e.g., `DatabaseLoader`) to fetch codes from a database instead of the default filesystem loader. Extend `FilesystemLoader` as a reference.
How should I handle validation errors in Laravel?
The package throws exceptions for invalid formats (e.g., `InvalidArgumentException`). Use Laravel’s exception handler to format errors consistently. Log violations for auditing or return user-friendly messages in APIs.
Can this package validate non-Czech accounts (e.g., EU IBANs)?
No, this package is optimized for Czech-specific validation (CNB rules). For EU-wide IBAN validation, consider `league/iban` alongside this package. Combine them in a service layer for broader coverage.
What’s the performance impact of validating 10,000+ accounts per minute?
The package is lightweight and stateless, making it suitable for high-throughput systems. Benchmark in your environment, but expect sub-millisecond latency for most validations. Cache results if repeated checks occur.
How do I test this package in Laravel unit tests?
Mock the validator in tests (e.g., `BankAccountNumberValidator::validate()`). Test edge cases like malformed inputs (`CZ123`), empty strings, and valid/invalid Czech accounts. Use Laravel’s `partialMock` for partial mocking if needed.
What if CNB changes validation rules in the future? Will this package break?
Monitor the package’s GitHub for updates. If rules change, the maintainers may release a patch. As a fallback, implement a secondary validation layer (e.g., CNB’s API) or fork the package for custom rules.
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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky