Address Library is a library used in the Laravel framework to create three address lists
- Country
- Governorate
- City
Each is dependent on the other: Country > Governorate > City
Installation is a very simple process, all you have to do is copy the folders to your framework
- Only the contents of file( routes/api.php ) are copied to avoid rewriting on file( api.php )
The use is twotrend
/address/country
It is used to retrieve all available countries
/address/country/1
It is used to fetch the city of one country with the code
/address/country/1/governorate
It is used to retrieve all governorates within a country
/address/country/1/governorate/1
It is used to retrieve one governorate with the code
/address/country/1/governorate/1/city
It is used to retrieve all cities located within a governorate
/address/country/1/governorate/1/city/1
It is used to retrieve a city specified by the code
AddressCode : It is the class from which the query about addresses begins, and it is of the static class type, so all the functions within it are of the static type.
$countrys = AddressCode::country();
$countrys = $country->list();
It is used to retrieve all available countries
$country = AddressCode::country(1);
$country = $country->id();
$country = $country->name_ar();
$country = $country->name_en();
$country = $country->name("en");
$country = $country->getData();
It is used to fetch the city of one country with the code
$governorates = AddressCode::country(1)->governorate();
// Or
$governorates = AddressCode::governorate(1);
It is used to retrieve all governorates within a country
$governorate = AddressCode::country(1)->governorate(1);
// Or
$governorate = AddressCode::governorate(1,1);
$governorate = $governorate->id();
$governorate = $governorate->name_ar();
$governorate = $governorate->name_en();
$governorate = $governorate->name("en");
$governorate = $governorate->getData();
It is used to retrieve one governorate with the code
$cities = AddressCode::country(1)->governorate(1)->city();
// Or
$cities = AddressCode::city(1,1);
It is used to retrieve all cities located within a governorate
$city = AddressCode::country(1)->governorate(1)->city(1)
// Or
$city = AddressCode::city(1,1,1)
$city = $city->id();
$city = $city->name_ar();
$city = $city->name_en();
$city = $city->name("en");
It is used to retrieve a city specified by the code
- Problem Solving
- Analytical Skills
- PHP
- Laravel
- JSON
- Object-Oriented Programming ( OOP )
- API
- Email: [email protected]
- LinkedIn: @moasaad
- GitHub: @moassaad