Pharaonic
Loading...

Getting Started

Locations

# Why Locations?

Locations is a package that provides a quick and easy methods to get timezones, continents, countries and states/cities for Laravel.

Supported Languages : Arabic, English.

# Installation

Install the latest version using Composer.

1composer require pharaonic/laravel-locations

# getTimeZones

List of timezones all over the world.

1$timezones = getTimeZones();
2 
3/**
4 * ...
5 * +\"Europe/Athens\": \"(UTC+02:00) Athens\"
6 * +\"Europe/Bucharest\": \"(UTC+02:00) Bucharest\"
7 * +\"Africa/Cairo\": \"(UTC+02:00) Cairo\"
8 * +\"Africa/Harare\": \"(UTC+02:00) Harare\"
9 * +\"Europe/Helsinki\": \"(UTC+02:00) Kyiv\"
10 * +\"Europe/Istanbul\": \"(UTC+02:00) Istanbul\"
11 * +\"Asia/Jerusalem\": \"(UTC+02:00) Jerusalem\"
12 * ...
13 */

# getContinents

List of all continents.

1$continents = getContinents();
2 
3/**
4 * +"AF": "Africa"
5 * +"AN": "Antarctica"
6 * +"AS": "Asia"
7 * ...
8 */

# getContinent

Getting name of a specific continent.

1echo getContinent('AF', 'ar'); // أفريقيا

# getCountriesNames

List of all countries names.

1$countriesNames = getCountriesNames();
2 
3/**
4 * +"AF": "Afghanistan"
5 * +"AX": "Aland Islands"
6 * +"AL": "Albania"
7 * +"DZ": "Algeria"
8 * +"AS": "American Samoa"
9 * ...
10 */

# getCountries

List of countries data all over the world.

1$countries = getCountries();
2 
3/**
4 * ...
5 * +"EG": array:9 [▼
6 * "iso" => "EGY"
7 * "name" => "Egypt"
8 * "native" => "مصر"
9 * "currency" => "EGP"
10 * "phone" => "20"
11 * "timezone" => "Africa/Cairo"
12 * "languages" => array:1 [▼
13 * 0 => "AR"
14 * ]
15 * "continent" => "AF"
16 * "capital" => "Cairo"
17 * ]
18 * ...
19 */

# getCountry

Getting single country data.

1$country = getCountry('EG', 'ar');

# getStates

List of states/cities of all countries and you can get list of states/cities of a specific country.

1$states = getStates('EG');
2/**
3 * +"ALX": "Alexandria Governorate"
4 * +"ASN": "Aswan Governorate"
5 * +"AST": "Asyut Governorate"
6 * .....
7 */

# getState

Getting name of a specific state/city.

1echo getState('ALX', 'EG'); // Alexandria Governorate

# Contributors

MoamenEltouny
13 Contributions
peter279k
1 Contributions