prinsfrank/standards
A collection of international standards as native PHP 8.1+ enums, pulled from sources like ISO, IANA, and the US Library of Congress. Automatically updated daily so reference data such as country, currency, and language codes stays accurate, with no manual maintenance required.
Build vs. buy — the core decision. This package turns a recurring build-vs-maintain question into a near-trivial "buy" (MIT, zero-cost, low-integration). Any roadmap item that needs country, currency, language, script, TLD, phone-prefix, or HTTP-status reference data would otherwise spawn an internal data-ownership project: sourcing tables, writing importers, tracking upstream changes, and defending accuracy in audits. That is weeks of engineering plus permanent maintenance for commodity data that is not a differentiator. Adopting this package reallocates that budget to product surface area.
Feature work it unblocks or de-risks:
Accept-Language, per-language display names, script and language-tag handling. This is the "go multi-market" epics list, and it front-loads the tedious 20% of i18n work.Scope decisions this forces (usefully). Because the data is shipped as code, "how fresh is our country list?" becomes a deliberate release-cadence decision with reproducible, version-pinned behavior — good for audits and deterministic tests — rather than an opaque runtime lookup. The trade-off to accept explicitly: no same-day updates without a deploy.
Effort and risk envelope. Composer install, PHP 8.1+, no service, no credentials, no runtime latency. Real costs are (a) an upgrade cadence and (b) deciding where the vendor enum types are allowed to appear in your domain.
Adopt when:
countries.php config file — this is usually a small, well-bounded refactor with a clear test story.Look elsewhere or wait when:
Decision rule: default to adopting for new i18n/geo/currency-adjacent work; require an ADR and an adapter boundary for existing monoliths where the vendor namespace would otherwise spread across domain code.
For executives (30 seconds). We would otherwise rebuild and perpetually maintain commodity reference data — country, currency, language, phone-prefix, TLD, and HTTP code lists — that every market we enter depends on. This package gives us that data, kept in sync daily with authoritative sources, as type-safe code under a permissive MIT license, with no service, no vendor contract, and negligible cost. The business case is cost avoidance plus accuracy: fewer data-staleness defects in checkout, forms, and geo-eligibility, and a defensible "our data is traceable to the standard" answer for enterprise and regulated buyers. The risk is contained: it is data, not a platform, and we isolate it behind a thin internal layer so it can be swapped.
For engineering leads (the practical case). Backed PHP 8.1 enums you can typehint, so invalid country/currency values become impossible to pass and match expressions become exhaustive. Rich cross-relations (Alpha2 ↔ Alpha3 ↔ numeric ↔ name, country → subdivisions, calling codes, currencies, languages, flag emoji, number formatting), plus group membership predicates for EU/EEA/Schengen/NATO/WTO. PHPStan level 10, high test coverage, semver with an UPGRADING.md, framework-agnostic and Laravel-friendly (enum casts, Rule::enum). Integration is one composer line; the only real work is replacing existing string constants and adding a regression test that asserts on a handful of enum values so a data refresh cannot silently shift behavior.
For product/design. We get localized country names, flag emoji, and region-aware number formatting for free, which shortens the "does this look native in five markets?" loop. Explicit non-goals to design around: no FX conversion, no address or phone validation logic, no flag imagery — those stay separate decisions.
Ask. Approve as a foundational dependency for the localization/expansion track; assign ownership of a quarterly dependency-update and data-diff review; fund an internal adapter layer so vendor enums do not leak across the domain.
How can I help you explore Laravel packages today?