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

Laravel Countries Laravel Package

lwwcas/laravel-countries

Eloquent-first country database for Laravel. Every ISO 3166 Alpha-2, Alpha-3 and numeric code, international phone code, currency, SVG and emoji flag, GeoJSON border and translation is a native Eloquent relationship—one Country:: call away, with no external API needed.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy for "country data" — a decision that recurs in almost every product. Country lists, ISO codes, dialing codes, currencies, and translations get rebuilt badly in-house on a per-team basis. This package turns a recurring 1–2 sprint chore into a composer require plus one Artisan command, which is the cleanest possible version of the "buy" argument.
  • Localization roadmap. Translated country and region names in 9 languages (with a documented, contributor-reviewed translation process) directly unblocks "ship in Spanish/Portuguese/Arabic/German markets" conversations. The opt-in per-language seeding is the PM-relevant part: it means localization scope can be phased by market instead of committed up front, and a new market later is an additive data operation, not a migration project.
  • Internationalization of core flows: address forms, checkout, KYC/onboarding, shipping, tax. Country selection is a dependency of nearly every revenue-critical form. Because countries are a real Eloquent model with a country_id foreign key, PMs can spec "store the country reference, not a free-text string" and get normalized reporting, segmentation, and analytics for free.
  • Geo/mapping features. GeoJSON borders and lat/long mean features like "draw the region we serve," choropleth dashboards, or country highlighting on a map become a UI task rather than a data-acquisition task. This is the strongest differentiator and the one most likely to justify adoption on its own.
  • Telephony and currency UX. Dialing codes and per-country currency data support phone input masking, country-aware currency defaults, and pricing displays without a second vendor or a hand-maintained mapping table.
  • De-risking external dependencies in the architecture review. "Zero external API calls; data seeded locally" is a PM-legible reliability and cost argument: no third-party rate limits, no per-lookup billing, no outage blast radius, predictable latency, and testable fixtures.
  • Data ownership and compliance conversations. Country data living in your database (not a vendor JSON file or SaaS endpoint) simplifies data-residency questions, offline/air-gapped deployments, and auditability of what reference data a given release shipped with.
  • Scope control on the roadmap. Because the package deliberately stops at countries (no states/cities/postal codes), it also helps draw a clean line in roadmap planning: "country-level localization ships now; sub-national addressing is a separate epic with a different vendor."
  • Reference data as a first-class, seeded, versioned artifact. Changelog-driven releases (language additions, ISO corrections like removing non-allocated AN) give PMs a concrete cadence to plan around and a story for how reference data gets corrected over time.

When to Consider This Package

Adopt when:

  • You are on Laravel 11, 12, or 13 (explicitly CI-tested across all three) and already comfortable with Eloquent as the integration surface.
  • Country selection is a real domain object, not a one-off dropdown — you need foreign keys from users, addresses, orders, or pricing into a countries table.
  • You need more than name + ISO2: flags in multiple formats, dialing codes, currencies, coordinates, GeoJSON, region hierarchy, population/GDP, or independence dates.
  • Multilingual country names matter for your roadmap, especially in Spanish, Portuguese, Arabic, German, Dutch, Italian, Russian, or Turkish markets.
  • You want deterministic, offline, seed-once reference data with no third-party API contract, per-request cost, or availability risk.
  • Your team is small and reference-data plumbing is not a competitive differentiator — this is exactly the kind of work to buy.
  • You can tolerate curated rather than live data: population, GDP, and independence dates are snapshots, not a feed.

Look elsewhere or build in-house when:

  • You need sub-national data — states/provinces, cities, postal codes, address validation, or tax jurisdictions. This package explicitly stops at the country level; you will need a second source and a plan for joining them.
  • You need live or frequently refreshed figures — FX rates, current population estimates, real-time geopolitical changes, sanctions lists, or VAT rates. Seeded data will drift, and a PM should price in an owner and a refresh cadence.
  • You need country data outside Laravel (a Node service, a data warehouse dimension table, a mobile client bundle). The value proposition here is Eloquent-native; that evaporates outside PHP/Laravel.
  • Maturity risk is unacceptable. 132 stars and 0 dependents means essentially no third-party production track record. If this is load-bearing for a regulated or enterprise product, weigh single-maintainer risk, the absence of a formal support contract, and a documented exit plan (the data is MIT-licensed and in your own DB, which is a genuine mitigation).
  • You need currency conversion, phone number validation/parsing (libphonenumber-grade), or geocoding. This supplies the data, not the algorithms — pair it with dedicated libraries rather than expecting it to replace them.
  • You already have a canonical country dimension (ERP, MDM, data platform) that must be the system of record. Duplicating it creates a reconciliation problem for no gain.
  • Your language set falls outside the 9 supported languages and you can't upstream contributions — you'd be maintaining a fork of translation data.

How to Pitch It (Stakeholders)

For executives — one paragraph: Country data is table stakes in every market we enter, and we currently rebuild it per feature, per team, per locale. This package replaces that with a single MIT-licensed dependency that seeds a proper countries table into our own database in one command — ISO codes, flags, currencies, dialing codes, coordinates, GeoJSON borders, and names translated into nine languages. It removes an external API from our architecture entirely: no per-lookup cost, no rate limits, no third-party outage risk, and no data leaving our infrastructure. The cost is a Composer line and one Artisan command; the payoff is that international address, checkout, and onboarding work stops starting from zero, and entering a new language market becomes a seeded data operation rather than a project.

For engineering — the practical case: It's an Eloquent-first model, not a helper returning an array from a JSON file. Country::whereIso('BR')->first() behaves like any model we wrote — relationships, scopes, eager loading, cacheable, testable — so country_id foreign keys on users and orders are just normal relationships. Installed and seeded via a single idempotent Artisan command with --force for CI/deploy and --languages=en,pt to seed only what we serve, keeping the table lean. CI-tested against Laravel 11/12/13 with a Pest suite; MIT licensed; data lands in our DB, so we can version it, fixture it, and roll it back with our own migrations.

Known risks to state openly, not bury: zero dependent packages today and effectively a single primary maintainer, so treat it as a vetted dependency rather than a vendor. It is country-level only — no states, cities, or postal codes — and demographics/economics are snapshots, not a live feed. Mitigation: the data is MIT and lives in our database, so our exposure is the integration code, not the dataset; keep a thin internal repository/abstraction over the model so replacement cost stays low, and pair it with dedicated libraries for phone parsing and currency conversion rather than asking it to do everything.

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.
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode