- How do I install byrokrat/banking in a Laravel application?
- Install it with Composer using composer require byrokrat/banking. The package ships no Laravel service provider, facade, config file, or validation rule, so there is no registration step. Use its classes directly in a domain layer or wrap them in a thin application service. Confirm that your PHP version satisfies the package constraint before installing.
- Does byrokrat/banking support Laravel 10 and Laravel 11?
- The library is framework-agnostic and has no Laravel version constraint. Version 2.2.3 declares PHP support as ^7.3 || ^8.0, which should resolve on PHP 8.1 through 8.4 under Composer caret semantics. However, the release only states PHP 8.0 support and a PHPUnit 9 build, so treat PHP 8.1 and newer as installs but unverified. Run the package suite on your target runtime before relying on it.
- Can I use byrokrat/banking with Laravel validation rules?
- There is no built-in Laravel validation rule in the package. You can write a custom Rule or a validation closure that calls the relevant value object parser and catches its descriptive exceptions. This keeps Swedish banking number validation inside Laravel's normal validation flow. Formatting can happen after validation or through a custom cast.
- What Swedish banking numbers can byrokrat/banking validate and format?
- It validates and formats Swedish bank account and clearing numbers, Bankgiro numbers, Plusgiro numbers, OCR references, BIC or SWIFT codes, and monetary amounts. Validation checks values against real Swedish numbering rules rather than accepting any string. It is a strict format and checksum library, so invalid or malformed input is rejected with descriptive exceptions.
- Is byrokrat/banking a payment gateway or bank API integration?
- No. It is a format, validation, and checksum library, not a payments or bank API client. It does not talk to Bankgirot, Swish, or any bank API and performs no network I/O. It can parse and generate payment files for BGC, Nordea, Handelsbanken, SEB, and Swedbank, but you still need your own transport or integration layer to send them.
- How do I generate and parse payment files with byrokrat/banking?
- The package supports parsing and generating payment files for BGC, Nordea, Handelsbanken, SEB, and Swedbank. You supply validated Swedish account, Bankgiro, Plusgiro, OCR, and amount data, then use the package to write or read the file format. It does not transmit files, so file delivery and bank connectivity remain your responsibility. Wrap this work in a service or queued job rather than putting it in a controller.
- How does OCR reference generation work in byrokrat/banking?
- The package can generate OCR references with amount and currency handling and validates them against Swedish OCR reference rules. OCR references are used to match incoming payments to invoices or orders, so store the generated reference with the related payment record. Validate externally supplied references before matching them to avoid malformed or ambiguous input. The library handles the reference format and checksum, not reconciliation logic.
- What are the maintenance and production risks of using byrokrat/banking?
- The package has a single-maintainer profile and low star count, and version 2.2.3 is a platform-compatibility patch rather than a broad maintenance commitment. The biggest functional risk is a stale bank registry, because clearing-number ranges and bank mappings change as Swedish banks consolidate. PHP 8.1 and newer are installs but untested, so pin the version and test on your runtime. The Unlicense makes forking viable if upstream stops responding.
- Are there alternatives to byrokrat/banking for Swedish Bankgiro and Plusgiro validation?
- The provided context does not name direct alternatives, so compare candidates on Swedish account, Bankgiro, Plusgiro, OCR, BIC, and payment-file coverage. Also check PHP 8.1 and newer support, transitive dependency health, and maintenance activity. byrokrat/banking is deliberately narrow and framework-agnostic, which makes it easy to isolate behind your own adapter.
- Does byrokrat/banking work on PHP 8.1, 8.2, and 8.3?
- Version 2.2.3 uses a ^7.3 || ^8.0 constraint, so Composer should resolve it on PHP 8.1, 8.2, and 8.3. The release itself only declares PHP 8.0 support and a PHPUnit 9 build, so newer runtimes are installable but not officially tested. Check that sibling byrokrat/* dependencies also resolve independently. Run the package suite under your target PHP version before production use.