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

Aba Bundle Laravel Package

latysh/aba-bundle

latysh/aba-bundle packages ABA functionality into a reusable PHP bundle, offering straightforward configuration and a clean service interface for adding it to your application. Lightweight, easy to install, and framework-friendly.

View on GitHub
Deep Wiki
Context7

Getting Started

First, calibrate expectations. This is a Symfony2 bundle, not a Laravel package. It ships no ServiceProvider, no facade, and its composer.json almost certainly pins symfony/symfony: ~2.x and friends. On any modern Laravel (9/10/11) composer require latysh/aba-bundle will either fail resolution or drag in EOL Symfony components you do not want in vendor/. With 1 star and 0 dependents, treat it as a reference implementation, not a dependency.

Practical entry path:

  1. Clone the repo and read src/ — you want the ABA record/writer classes (header record, detail/transaction records, trailer, file-total) and the DI extension. There is no docs site; the code is the spec.
  2. Decide: (a) port those classes into app/Support/Aba/ and bind them in AppServiceProvider, or (b) if you are on a legacy Symfony 2 app, wire them via services.yml. For Laravel, (a) is the only sane route — 3–5 small classes, trivially vendor-free.
  3. First use case: a weekly supplier payment run or payroll batch. Build the header (your BSB, account, remitter name, date), append one detail record per payment, close with the trailer and file-total, write a .aba file to Storage::disk('local').
$file = app(AbaFile::class)
    ->header($companyBsb, $companyAccount, 'ACME PTY LTD', now())
    ->addDetail($supplierBsb, $supplierAccount, 5000, /* cents */ 'INV-1024')
    ->addDetail(...);
$file->close(); // computes totals
Storage::put("aba/{$batch->id}.aba", $file->toString());

Implementation Patterns

DTO-per-transaction. Map Eloquent models (Invoice, PayrollLine) into plain ABA detail objects in a single transformer class. Keep the file writer dumb — it takes an array of details and emits text. This makes golden-file tests trivial and lets you unit-test the mapping without a database.

Money is integer cents, always. (int) round($amount * 100). Never let a float or a formatted string near the writer; ABA amounts are zero-padded fixed-width and 1,234.56 silently corrupts the file.

Config over hardcoding. Put BSB, account number, remitter name (16 chars), user-preferred name (12 chars), and transaction codes in config/aba.php. Transaction codes are the thing finance teams change: 50 = credit to external account, 53 = payroll, 13 = debit. Don't bury them in the writer.

Queued job + audit trail. Generate inside GenerateAbaFileJob, write to local or s3, then persist a row: file hash, batch id, detail count, credit total, debit total. When the bank statement lands, you reconcile by hash and by the remitter/withheld reference, not by eyeballing the file.

Testing. Snapshot the exact byte output of a small fixture (e.g. 3 details). Assert line length is 120 on every record and that trailer totals equal the sum of details. This catches 90% of real-world rejections.

Validation before hand-off. Add a AbaValidator that checks BSB is 6 digits, account ≤ 9 digits, names contain only uppercase ASCII/punctuation, amounts > 0, and totals balance. Run it before you ever email the file to the bank.

Gotchas and Tips

  • Abandoned. Symfony 2.x has been EOL since 2018. Expect zero maintenance, no PHP 8.2+ fixes, and likely deprecated syntax. Fork-and-port is the honest recommendation; cite the original MIT licence.
  • Fixed-width padding is the whole game. Numbers zero-pad left, text space-pads right, and text truncates at its field width. Most bugs are off-by-one padding or a 33-character name silently shifting every subsequent field. Assert strlen($line) === 120 on write.
  • Line endings. Banks are inconsistent; many validators want CRLF (\r\n), some tolerate LF. Get a known-good sample .aba from your actual bank and diff yours against it byte-for-byte. diff <(xxd yours) <(xxd theirs) is your friend.
  • Debit vs credit direction. Codes are from your account's perspective, not the payee's. This is the classic sign-error that produces an inverted file the bank may still accept.
  • Trailer arithmetic. You need net total, total credits, and total debits, all in cents, and they must reconcile exactly against detail rows. Off-by-one in the file-total record causes hard rejection with unhelpful bank error messages.
  • BSB and account formatting. Six-digit BSB without hyphen; account numbers left-padded, not with leading zeros assumed. Strip spaces and hyphens from stored data before writing.
  • Character set. Uppercase, strip accents and smart quotes; & and ' behaviour varies by bank. Sanitise at the transformer, not the writer.
  • Extension point. If you need a new transaction code or a "withheld tax" flag, subclass the detail record rather than editing it — the package's structure (if anything) survives into your port.
  • Don't trust the bundle's tests as the spec. Cross-check everything against the ABA Direct Entry User Guide and your bank's own validator/staging environment. If the package disagrees with the bank, the bank wins.
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.
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels
wazza/laravel-db-encryption
hokny/laravel-generator
vonsogt/backup
jengo/queues
jeremykenedy/laravel-observability
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums