Download the PHP package enadabuzaid/country-data without Composer
On this page you can find all versions of the php package enadabuzaid/country-data. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download enadabuzaid/country-data
More information about enadabuzaid/country-data
Files in enadabuzaid/country-data
Package country-data
Short Description Laravel package for country information (config-based, reusable, and localized)
License MIT
Informations about the package country-data
Laravel Country Data
A clean and reusable Laravel package for accessing comprehensive country information โ including localized names, flags, dial codes, currencies, timezones, and more โ all stored in a config/countries.php
file for maximum performance.
๐ฏ๐ด Built with multilingual support, region filters, and helper methods โ ideal for dropdowns, admin panels, and international applications.
โ Features
- ๐ฆ Publishable country list as
config/countries.php
- ๐ Multilingual support (English and Arabic)
- ๐ Filters for Arab, Gulf, Muslim-majority, Continents, and more
- ๐ Dial codes with emoji flags and SVG URLs
- ๐ Search countries by name, code, or filter
- ๐งฉ Helper formatters for frontend select menus
- โก Laravel-native config access (uses
config()
andconfig:cache
)
๐ Installation
Add the package locally:
Publish the config file:
This will copy countries.php
into your Laravel app's config folder:
๐ Documentation
๐ Available Static Methods
Method | Description |
---|---|
getArabCountries() |
Returns all Arab countries |
getGulfCountries() |
Returns Gulf Cooperation Council countries |
getByFilter('muslim-majority') |
Returns countries by custom filter |
getByCode('SA') |
Gets full country data by code |
searchByName('Jordan') |
Finds country by name in English or Arabic |
getName('JO', 'ar') |
Returns the name of a country in a specific locale |
getFlag('JO') |
Returns the flag emoji |
getDialCodes(true) |
Returns list of dial codes, optionally with flags |
getSelectOptions('ar') |
Returns array for select dropdowns (label + value) |
๐ Example: Get Dial Codes with Flags
Returns:
๐ Example: Get Arab Countries
๐ Example: Search by Arabic Name
๐ Example: Select Options for Vue/React
๐ง Extensible Filters
Available filters
on countries include:
arab
gulf
muslim-majority
middle-east
asia
,africa
,europe
,north-america
, etc.
๐ File Structure
๐งช Coming Soon
getByContinent('Asia')
getSelectOptionsWithFlags()
country-data:export-json
command- Optional database support
๐ License
MIT โ built by @enadabuzaid