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

Standards Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • The package is a pure, dependency-free PHP 8.1+ library: backed enums plus static relationship helpers. No framework coupling, no service provider, no config, no I/O, no global state. That is close to the ideal shape for a reference-data dependency — it composes cleanly into Laravel without touching the container or bootstrapping.
  • Reference data (ISO 3166 country codes/subdivisions, ISO 4217 currencies, ISO 639 languages, IANA TLDs and URI schemes, SIX currency minor units and symbols, HTTP methods/status codes, country groups) currently lives either as hardcoded arrays, config files, DB lookup tables, or is duplicated across services in most Laravel estates. Replacing those with typed enums is a net architectural improvement: invalid values become a type error at the boundary rather than a silent string.
  • The enum relationship graph (alpha2 ↔ alpha3 ↔ numeric ↔ name, currency ↔ country, language ↔ country ↔ script, TLD → country) removes a class of bespoke join logic — but it also invites coupling core domain models to a third-party namespace. For a typical product this is acceptable; for a long-lived domain core with its own published API contract, plan a thin anti-corruption layer so enum churn doesn't leak outward.
  • Main architectural caveat: these are compile-time constant sets, not queryable data. Anything requiring "list all countries where…", pagination, admin editing, or a FK relationship still wants a database table seeded from the enums. Treat the package as the source of truth for validation and transformation, not as a replacement for reference tables you join against.

Integration feasibility

  • Trivially low. composer require prinsfrank/standards, one PHP version constraint, zero transitive dependencies, MIT license. A spike can be done in an afternoon and thrown away without residue.
  • Laravel-native hooks exist without the package doing anything: Rule::enum(), enum casts on Eloquent models, Enum::from() in form requests, ->value in API resources. The package is effectively "Laravel-ready by being framework-agnostic."
  • Gaps to plan for: no localization of display names beyond a limited set of country names by language; no validation/normalization helper for loosely formatted input (you still need trimming, case folding, and tryFrom wrapping); no documentation site — the README is the API reference and it is long but dense.

Technical risk

  • Case-name instability (highest risk). Case identifiers are generated from upstream human-readable names, e.g. CountryAlpha3::Netherlands, CountryCallingCode::Netherlands_Kingdom_of_the. When upstream renames a territory or qualifier, the case name changes. That is a breaking change for any code that references case names, and semver allows it to ship in a major only — but it is easy to miss in review. Mitigation: ban direct case-name references in application code; use from()/tryFrom() against canonical values and serialize ->value.
  • Additive changes are breaking in practice. New enum cases in a minor release will break exhaustive match without a default arm, Enum::cases() snapshot tests, and "complete list" assertions. Semver says this is fine; your CI will disagree. Treat every bump as potentially breaking until tests say otherwise.
  • Data provenance and freshness. Daily automated ingestion from ISO/IANA/SIX/LoC with manual review. Excellent cadence, but the failure mode is silent staleness: if an upstream parser breaks, badges go red and nothing else happens. There is no SLA, no versioned data snapshot, no changelog of individual data corrections that I can verify from the README.
  • Single-maintainer, sponsorship-funded bus factor. Active and responsive by all appearances, but no commercial support path. Mitigating factor: the package is small, single-purpose, and forkable in hours.
  • Large generated enums. CountrySubdivision, LanguageAlpha3Extensive, and the TLD enums contain thousands of cases. Fine at autoload/opcache level for typical use; do not call ::cases() in hot paths or in Blade loops without caching.
  • Policy-laden data. Country groups (EU, NATO, BRICS, WTO, Schengen), disputed-territory naming, and country/currency availability are politically and legally sensitive in some markets. Sourcing them from upstream is convenient but means you own the consequences.
  • Weak ecosystem signal. 489 stars but 0 dependents is unusual — it suggests adoption in applications rather than as a transitive dependency. Low supply-chain risk (no deps), but limited peer validation of edge cases.

Key questions

  1. What is our acceptable staleness window for currency, country, and TLD data, and who owns the "upstream parser broke" alert?
  2. Which of our existing reference datasets are these enums meant to replace, and which must remain DB tables because we need to query, localize, or edit them?
  3. Do we need localized display names for countries/languages/currencies? If yes, where does that data come from — this package or our translation layer?
  4. How do we handle codes that are withdrawn upstream (e.g. retired currencies, reassigned country codes) that still exist in historical records?
  5. Are we comfortable publishing alpha2/alpha3 codes — not names — as our external API contract, per the package's own recommendation?
  6. Who reviews upstream data changes (naming of disputed territories, group membership) before they land in production?
  7. What is our policy on enum case renames — do we patch, pin, or fork?
  8. Is there overlap with packages already in the tree (league/iso3166, symfony/intl, Laravel's Http constants) that would create two sources of truth?
  9. What is the contingency if maintenance stalls — fork, vendor, or migrate back to generated DB tables?

Integration Approach

Stack fit

  • Composer-only dependency; works unchanged on Laravel 9–12 and any PHP 8.1+ runtime. No bootstrapping, no published config, no assets.
  • Recommended thin adapter inside the app (one small namespace, e.g. App\Support\Standards) providing: enum validation rules, Eloquent casts, a cached cases() list provider, and normalization helpers (tryFrom on trimmed/uppercased input). This keeps library churn contained to one directory.
  • Persistence convention: store canonical scalars — char(2)/char(3) for country and currency codes, smallint for numeric country codes — never the case name and never a DB ENUM column. Hydrate to the enum at the boundary via cast; accept null on read for historical rows.

Migration path

  1. Inventory — grep for hardcoded country/currency/language/HTTP-status arrays, config maps, and local Enums. Rank candidates by blast radius.
  2. Pilot one bounded context — currency in billing/pricing is the highest-value, lowest-blast-radius start (minor units and symbols are directly monetizable correctness wins).
  3. Build the adapter and a contract test — snapshot the codes you actually use, assert they resolve, and fail the build if a bump removes one.
  4. Parallel-run — where a legacy table exists, assert legacy.code === enum->value for the overlapping set in CI before cutting over.
  5. Expand — country/locale next (validation + API serialization), then HTTP status/method for internal API contracts, then TLD/URI scheme if you do URL or email validation beyond Laravel defaults.
  6. Decommission — delete legacy arrays/tables only after the contract test has run green for a full release cycle.

Compatibility

  • Verify no existing package already owns ISO 3166 or 4217 data; two sources of truth is worse than the status quo. If symfony/intl is present for formatting, keep it for formatting and this package for identity/validation, and say so in an ADR.
  • Confirm PHP floor alignment across app, CI, and any preloading config. PHP 8.1 minimum is likely already satisfied.
  • Pin in composer.lock; use a caret range in composer.json so security/data fixes can flow, but gate merges of automated bumps behind the contract test.

Sequencing and effort

  • Realistic effort: days, not weeks, for the first context; the rest is incremental and independently shippable.
  • Sequence the governance work in parallel with the technical work — the ADR, the "never reference case names" lint rule, the snapshot contract test, and the automated-bump policy. Without those, the integration cost is deferred, not avoided.

Operational Impact

Maintenance

  • Upstream syncs daily, so release cadence is high and mostly additive. Plan for a monthly dependency-review ritual (grouped Renovate/Dependabot PRs, contract test as the merge gate, changelog skim for renames before merging).
  • Budget a small recurring owner: someone who reads upstream data changes and decides whether a territory rename or currency withdrawal needs product action. This is a data-governance task masquerading as a dependency bump.
  • Keep a recorded fork contingency: the package is small enough that a hard fork (vendor it, delete CI workflows, keep the enums) is an hours-not-weeks fallback.

Support

  • Community-only, MIT, no warranty, single maintainer funded by sponsorship. Escalation path is "open an issue, or fix it upstream, or patch locally." Acceptable for reference data; not acceptable if the data becomes load-bearing for a regulated workflow without a documented fallback.

Scaling

  • Excellent runtime characteristics: stateless, immutable, zero I/O, zero DB round trips. Ideal for high-fan-out and multi-tenant request paths; no cache invalidation surface.
  • Two watch items: (a) ::cases() on the large enums (CountrySubdivision, LanguageAlpha3Extensive) — memoize or move to a cached config/collection when used for dropdowns; (b) do not add these enum classes to an opcache preload list wholesale.
  • If you need to join on reference data at scale, seed tables from the enums and query the tables. Don't iterate enums in query-building code.

Failure modes

Failure Symptom Mitigation
Upstream parser breaks Data silently stale; only a red CI badge upstream Periodic freshness check against a known-mutable value; alerting
Code withdrawn/renamed upstream ValueError from ::from(), or failed cast on hydration Use tryFrom() everywhere; explicit null handling; never case-name references
Exhaustive match after minor bump UnhandledMatchError in production, not CI, if coverage is partial Default arm with logging, or strict contract test over the used set
Wrong minor units or symbols Rounding/display errors in money paths Spot-check currency table against finance's canonical list before cutover
Wrong calling code / TLD SMS routing failures, validation gaps Contract test on the specific codes in use; monitor rejection rates
Maintainer unavailability No fixes for a data error Fork plan documented and rehearsed once
Political/disputed naming Market-specific compliance or PR incident Product/legal review of exposed display names; expose codes, not names

Ramp-up

  • Very low for a mid-level Laravel developer: hours to first productive use. The README is comprehensive and example-led; there is no separate API docs site, so capture internal notes and one ADR.
  • The conceptual hazards are narrow but worth onboarding explicitly: from() vs tryFrom(), ->value vs ->name, case names being data-derived and unstable, and the rule that persisted values are scalars.
  • Add two guards to the onboarding checklist: a static-analysis rule forbidding PrinsFrank\Standards\*\*::SomeCaseName in application code, and a code-review note that any new match over a package enum requires a default arm.
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.
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource