2017 © Pedro Peláez
 

project wishi

An agnostic package to get different countries, states and counties.

image

claz/wishi

An agnostic package to get different countries, states and counties.

  • Tuesday, July 26, 2016
  • by andela-tolotin
  • Repository
  • 6 Watchers
  • 18 Stars
  • 19 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 5 Open issues
  • 31 Versions
  • 0 % Grown

The README.md

# Locator

Coverage Status Build Status StyleCI
If you have ever needed basic information about countries, and their states, then Locator is for you. Locator is a PHP package that works with the Yahoo API. It returns data that you need just by calling one method. There is a Service Provider and a Facade to make it easy to integrate with your Laravel project. It can also be used with other PHP frameworks like Lumen, CakePHP, Zend, etc. Version 1.0.0 only provides information about the following: * Countries * States in the country * Counties in the state, (*1)

## Dependencies

  • PHP 5.5+
  • Composer 1.4+
  • Apache

## Getting Started

To use this package with a PHP project, first require the package using composer., (*2)

composer require claz/wishi
  • Note that you must be registered in Yahoo as a developer. Add your Yahoo details to your environment variables.
YAHOO_CLIENT_ID=*********************************

Using plain PHP

If you are using this project with a plain PHP project, follow the following steps:, (*3)

  • Run composer dumpautoload if required.
  • Require autoload.php and load the package with its dependencies.
require_once ('vendor/autoload.php')

use Wishi\Controllers\Locator;
  • Instantiate the Locator class and you are good to go.
$locator = new Locator();

Using with Laravel

If you are using this project with Laravel, follow the following steps:, (*4)

  • Open app.config in config folder and,, (*5)

  • Register the ServiceProvider inside config.php, (*6)

Wishi\Providers\LocatorServiceProvider::class,
  • To use the Facade, simple add it to the same file.
Locator => Wishi\Facades\Locator::class,
  • Import the Facade into your project.
use Locator;

### Example

  • To get all the countries.
// With normal PHP applications
$countries = $locator->getCountries();

// With the Facade in Laravel applications
$countries = Locator::getCountries();

var_dump($countries); // Collection of countries
  • To get all the states in a country.
// With normal PHP applications
$states = $locator->getStates('Nigeria');

// With the Facade in Laravel applications
$states = Locator::getStates('Nigeria');

var_dump($states); // Collection of states
  • To get all the counties in a state.
// With normal PHP applications
$counties = $locator->getCounties('Lagos');

// With the Facade in Laravel applications
$counties = Locator::getCounties('Lagos');

var_dump($counties); // Collection of counties

One very common use is illustrated below in a Laravel project that lists all the state in the Nigeria., (*7)

<ul>
@foreach(Locator::getStates('Nigeria') as $state)
    <li> {{ $state->name }} </li>
@endforeach
</ul>

## License

This project uses the MIT License feel free to contribute., (*8)

The Versions

26/07 2016

dev-master

9999999-dev

An agnostic package to get different countries, states and counties.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework php

26/07 2016

dev-fix-circleCI-issue

dev-fix-circleCI-issue

An agnostic package to get different countries, states and counties.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework php

26/07 2016

dev-develop

dev-develop

An agnostic package to get different countries, states and counties.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework php

25/07 2016

v1.0.2.1

1.0.2.1

An agnostic package to get different countries, states and counties.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework php

25/07 2016

v1.0.2

1.0.2.0

An agnostic package to get different countries, states and counties.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework php

25/07 2016

v1.0.1

1.0.1.0

An agnostic package to get different countries, states and counties.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework php

25/07 2016

dev-include-badges

dev-include-badges

An agnostic package to get different countries, states and counties.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework php

25/07 2016

dev-seperate-concerns

dev-seperate-concerns

An agnostic package to get different countries, states and counties.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework php

25/07 2016

v1.0.0

1.0.0.0

An agnostic package to get different countries, states and counties.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework php

22/07 2016

dev-create-new-controller

dev-create-new-controller

An agnostic package to get different countries, states and counties.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework php

21/07 2016

dev-modify-readme

dev-modify-readme

An agnostic package to get different countries, states and counties.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework php

15/07 2016

dev-test-for-exceptions

dev-test-for-exceptions

An agnostic package to get different countries, states and counties.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework php

14/07 2016

dev-test-for-states-and-counties

dev-test-for-states-and-counties

An agnostic package to get different countries, states and counties.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework php

14/07 2016

dev-test-for-countries

dev-test-for-countries

An agnostic package to get different countries, states and counties.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework php

14/07 2016

dev-ft-create-exception

dev-ft-create-exception

An agnostic package to get different countries, states and counties.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework php

13/07 2016

dev-ch-set-up-continuous-integration

dev-ch-set-up-continuous-integration

An agnostic package to get different countries, states and counties.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework php

13/07 2016

dev-ch-create-tests-for-package

dev-ch-create-tests-for-package

An agnostic package to get different countries, states and counties.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework php

13/07 2016

dev-create-readme

dev-create-readme

An agnostic package to get different countries, states and counties.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework php

12/07 2016

dev-ft-create-locator-serviceprovider

dev-ft-create-locator-serviceprovider

The Laravel Lumen Framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework lumen

12/07 2016

dev-ft-create-locator-facade

dev-ft-create-locator-facade

An agnostic package to get different countries, states and counties.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework php

12/07 2016

dev-ft-rename-app-name

dev-ft-rename-app-name

The Laravel Lumen Framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework lumen

12/07 2016

dev-hotfix-extend-location-to-county

dev-hotfix-extend-location-to-county

The Laravel Lumen Framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework lumen

12/07 2016

dev-ft-get-state-counties

dev-ft-get-state-counties

The Laravel Lumen Framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework lumen

12/07 2016

dev-ft-create-collection-of-states

dev-ft-create-collection-of-states

The Laravel Lumen Framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework lumen

12/07 2016

dev-ft-new-package

dev-ft-new-package

The Laravel Lumen Framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework lumen

12/07 2016

dev-ft-create-collection-of-country-objects

dev-ft-create-collection-of-country-objects

The Laravel Lumen Framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework lumen

10/06 2016

dev-ch-abstract-some-methods

dev-ch-abstract-some-methods

The Laravel Lumen Framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework lumen

10/06 2016

dev-ft-create-constructor-for-requests-121263443

dev-ft-create-constructor-for-requests-121263443

The Laravel Lumen Framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework lumen

09/06 2016

dev-ft-get-all-countries

dev-ft-get-all-countries

The Laravel Lumen Framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework lumen

09/06 2016

dev-ft-create-controller

dev-ft-create-controller

The Laravel Lumen Framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework lumen

09/06 2016

dev-ft-create-endpoints-broilerplates-121224909

dev-ft-create-endpoints-broilerplates-121224909

The Laravel Lumen Framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework lumen