Locations

Locations

Locations provides a quick and easy methods to get Timezones, Continents, Countries and States

Moamen Eltouny (Raggi)
PHP Version : >= 7.2 Laravel Version : >= 6.0 License Support
Source Packagist Version Packagist Downloads

Install

Install the latest version using Composer

composer require pharaonic/laravel-locations

Supported Languages

1- Arabic.

2- English.

Usage

TimeZones

Getting timezones list.

$timezones = getTimeZones();

/**
*	...
*	+"Europe/Athens": "(UTC+02:00) Athens"
*	+"Europe/Bucharest": "(UTC+02:00) Bucharest"
*	+"Africa/Cairo": "(UTC+02:00) Cairo"
*	+"Africa/Harare": "(UTC+02:00) Harare"
*	+"Europe/Helsinki": "(UTC+02:00) Kyiv"
*	+"Europe/Istanbul": "(UTC+02:00) Istanbul"
*	+"Asia/Jerusalem": "(UTC+02:00) Jerusalem"
*	...
*/

Continents

Getting single/multiple continents.

$continents = getContinents();
/**
*	+"AF": "Africa"
*	+"AN": "Antarctica"
*	+"AS": "Asia"
*	...
*/

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

Countries

Getting single/multiple countries.

$countriesNames = getCountriesNames();
/**
*	+"AF": "Afghanistan"
*	+"AX": "Aland Islands"
*	+"AL": "Albania"
*	+"DZ": "Algeria"
*	+"AS": "American Samoa"
*	...
*/

$countries = getCountries();
/**
*	...
*	    +"EG": array:9 [▼
*	    	"iso" => "EGY"
*	    	"name" => "Egypt"
*	    	"native" => "مصر‎"
*	    	"currency" => "EGP"
*	    	"phone" => "20"
*	    	"timezone" => "Africa/Cairo"
*	    	"languages" => array:1 [▼
*	    		0 => "AR"
*	    	]
*	    	"continent" => "AF"
*	    	"capital" => "Cairo"
*	    ]
*	...
*/

$country =  getCountry('EG', 'ar'); // Same result with "name" => "مصر"

States

Getting single/multiple states.

$states = getStates('EG');
/**
*	+"ALX": "Alexandria Governorate"
*	+"ASN": "Aswan Governorate"
*	+"AST": "Asyut Governorate"
*	.....
*/

echo getStates('ALX', 'EG'); // Alexandria Governorate