torann/address-format
Torann/address-format is a PHP package that formats postal addresses using country-specific conventions. Provide address components and a country code to generate correctly ordered, multi-line output, with Laravel support and configurable templates for consistent address display.
Architecture fit. This is a presentation-layer utility, not a domain service. It maps a structured address (street, locality, administrative area, postal code, country) plus a country code onto a localized string using a config-driven template table. That is a narrow, stateless, side-effect-free function — which is exactly what you want in a formatter. It fits cleanly behind an interface (AddressFormatter) with a thin adapter wrapping the facade, and it must not leak into controllers, models, or Blade. The correct architectural decision it reinforces is bigger than the package: persist canonical structured columns and format only at render/print time. That schema decision is a PM-ratifiable choice and is far cheaper now than after the schema hardens around a display blob.
Integration feasibility. Low effort, low ambiguity. composer require, vendor:publish, read config/address-format.php, pass an array, get a string. The README example is effectively the entire API surface — there is no deep integration to design. Realistic cost: half a day for a developer to get first output, one to two days to do it properly (contract, value object, adapter, golden-file tests, Blade component). The work is not the integration; the work is the discipline around it.
Technical risk. The risks are concentrated and mostly organisational, not technical:
Key questions for the team.
^1.x pin with a recorded sunset expectation)?Stack fit. Native Laravel: service provider, facade, publishable config. It presumes a modern PHP runtime (8.2+ for 2.x) and a standard Laravel config-cache deploy. It has no database, queue, or cache dependencies, so it drops into any Laravel service without touching infrastructure. The only genuine coupling is the config file — which is the product.
Migration path. There is no data migration; the migration is a schema discipline migration. Move from hardcoded string concatenation in views and PDF templates to: structured columns → Address value object → AddressFormatter contract → adapter → facade. Bind in a service provider and never reference AddressFormat:: outside the adapter. That single habit converts the abandonment risk from an open question into a one-file swap to commerceguys/addressing if CLDR-backed coverage or active maintenance later becomes a requirement. Cost of that resistance: about an hour. Cost of skipping it: a codebase-wide search-and-replace plus re-test.
Compatibility considerations.
^2.0 or 2.0.*) per service; do not let the resolver choose. Any service that cannot reach PHP 8.2 gets a deliberate ^1.x pin and a documented sunset — there will be no maintenance branch and no backported fixes.config:cache must re-run in deploy. Put it in the deploy script explicitly; a "template not taking effect" report is almost always stale cached config.Sequencing.
config/address-format.php for launch markets (US, GB, DE, JP at minimum) and validate line order, separators, and which components appear at all against brand and carrier expectations. Wrong template = config override, never a code change.Maintenance. Single maintainer, low stars, zero dependents, sporadic releases. Treat the template config as vendored data, not as an upstream responsibility. Budget a small recurring allowance (roughly a half-day per quarter for a modest market set) to review and patch templates for markets you actually serve. Decide and record now who owns that patch. Because the licence is BSD-2-Clause, forking the config — or the whole library — is legitimate and cheap; make that the documented contingency rather than a scramble.
Support. There is no vendor. Support is internal by definition. That means: named owner, an ADR recording why this package was chosen over commerceguys/addressing, golden fixtures checked in, and a runbook note that the PHP floor changed at 2.0.0 so nobody later downgrades the package to fit an older runtime.
Scaling. Runtime cost is negligible — pure string assembly, no I/O. The two scaling concerns are both code-level, not load-level:
Failure modes to instrument.
required_if validation upstream, and golden-file tests. Do not expect the library to complain.The package will never tell you it produced bad output, so the real monitor is downstream: undeliverable shipments, failed address verification, and support tickets mentioning address errors. Wire those to a dashboard before the second market goes live.
Ramp-up. Very shallow. A mid-level Laravel developer is productive in under a day; the package's entire conceptual surface is one function and one config file. The learning investment is not in the library but in the surrounding discipline — adapter boundary, value object, golden fixtures, explicit fallback — which is one to two days and is transferable to whatever replaces this package.
TPM position. Treat this as a low-cost stopgap or vendorable code sample that unblocks localized address display for a market launch, not as a platform standard. Ratify the structured-schema decision alongside it, keep the adapter boundary non-negotiable, and keep commerceguys/addressing on the bench. The opportunity score (21.58) and 0.325 composite are consistent with that framing: cheap to adopt, cheap to abandon, and not something to build a roadmap on.
How can I help you explore Laravel packages today?