Skip to content

moassaad/address-list-lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Address List Lib

Introduction

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

Install

Installation is a very simple process, all you have to do is copy the folders to your framework

Note

  • Only the contents of file( routes/api.php ) are copied to avoid rewriting on file( api.php )

Useing

The use is twotrend

The first trend is to use the API application

/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

The second trend is at the application programming level

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

Skills

  • Problem Solving
  • Analytical Skills
  • PHP
  • Laravel
  • JSON
  • Object-Oriented Programming ( OOP )
  • API

Libraries

Contact Me

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages