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

Countries Laravel Package

fleetbase/countries

Country data for Laravel and Fleetbase applications: ISO codes, names, dial codes, currencies, and flags, with helpers for validation, lookups, and seeding. Drop-in package for consistent, localized country lists and forms.

Deep Wiki
Context7

Laravel countries and currencies

Frequently asked questions about Countries
How do I install fleetbase/countries in a Laravel app?
Install it with Composer using composer require fleetbase/countries. In a standard Laravel application the package should be discovered automatically; if your app disables package discovery, register its service provider manually. After installation you can start using its country helpers, validation rules, and Blade-friendly data.
Which Laravel versions are supported by fleetbase/countries?
The package is built for Laravel applications, but the README overview does not list exact Laravel and PHP version constraints. Check the composer.json require section and the Packagist release metadata before installing it in an older or newly upgraded Laravel project. That is especially important if you rely on framework features such as validation rule objects or package auto-discovery.
What country data does fleetbase/countries include for each country?
It includes country names, ISO 3166 alpha-2 and alpha-3 codes, currencies, international dialing prefixes, and flags. That gives you a single dataset for forms, address normalization, phone input, and display logic. The package is designed to avoid hardcoded country arrays scattered across your application.
How can I look up a country by ISO alpha-2 or alpha-3 code?
Use the package's lookup helpers to resolve a country from its ISO alpha-2 or alpha-3 code instead of maintaining your own map. The bundled dataset contains both code formats, so the same record can support storage codes, display names, dial prefixes, currencies, and flags. Keep lookups centralized in the package so validation and presentation stay consistent.
Can fleetbase/countries be used for Laravel validation rules?
Yes. The package is described as providing Laravel-friendly validation rules for country input, so you can validate submitted country codes against the bundled ISO dataset. This helps reject invalid alpha-2 or alpha-3 values before they reach your address or billing logic. Combine it with your existing form request validation for consistent country handling.
How do I populate a country dropdown in a Blade view?
The package integrates with Blade views and provides the full country dataset, so you can loop over countries to build select options. Use the ISO alpha-2 code as the option value and the country name for the label, and include currency, dial code, or flag data where your UI needs it. Because the data comes from the package, you avoid duplicating a country list in every Blade template.
Does fleetbase/countries integrate with Eloquent models?
The package is designed to integrate cleanly with Eloquent models, which makes it useful for normalizing and storing country data alongside addresses, customers, or orders. You can use package lookups when casting, validating, or presenting country codes rather than embedding arrays in your models. Exact traits or casts should be confirmed in the package documentation.
How does caching work in fleetbase/countries?
The package includes configurable caching for repeated country queries, which helps when country lists or lookups are used across many requests. Caching is especially useful for form dropdowns, validation lookups, and API responses that reference country metadata. Review the package configuration to choose a cache store and clear cached data after deployment if your country dataset changes.
Can I seed countries into my database with fleetbase/countries?
The package is positioned for seeding and consistent country lists, so you can use its dataset as the source for database seeders or import routines. This is useful when you want countries stored in your own tables for joins, reporting, or admin editing. Keep the package as the canonical source and regenerate your seed data when you update the dependency.
Is fleetbase/countries better than hardcoding country lists or calling an external country API?
For Laravel applications, fleetbase/countries avoids the maintenance burden of hardcoded lists and the latency or availability concerns of external country APIs. It ships the dataset locally with zero external dependencies and adds helpers, validation rules, caching, and Blade-friendly integration. If you need real-time updates from a third-party service, an API may still fit, but for most forms and address normalization the local package is simpler.
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.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo