Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/emmadonjo/naija
Naija is a PHP package that provides data about States, Local Government Areas, cities, and towns in Nigeria.
https://github.com/emmadonjo/naija
naija naijastates nigeria php
Last synced: about 1 month ago
JSON representation
Naija is a PHP package that provides data about States, Local Government Areas, cities, and towns in Nigeria.
- Host: GitHub
- URL: https://github.com/emmadonjo/naija
- Owner: emmadonjo
- License: mit
- Created: 2024-07-31T13:08:43.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-09-25T11:29:30.000Z (3 months ago)
- Last Synced: 2024-10-07T02:48:36.010Z (3 months ago)
- Topics: naija, naijastates, nigeria, php
- Language: PHP
- Homepage: https://github.com/emmadonjo/naija
- Size: 7.56 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
Naija is a PHP package that provides data about States, Local Government Areas, cities, and towns in Nigeria.
This package is inspired by [https://github.com/Mercyware/Nigerian-States](https://github.com/Mercyware/Nigerian-States).
With this package you can retrieve the following state-related information:
- Name
- Capital
- Political Zone
- Creation Date
- Polution - Male and female
- Website
- Logo
- Flag
- Nick Name
- Languages
- Local Governments Areas
- Areas - villages, towns, and cities## Usage
Install via:
```php
composer require emmadonjo/naija
``````php
use Emmadonjo\Naija\Naija;// get list of states with minimal information
$states = Naija::states();// get the comprehensive information of a state
$state = Naija::state('Abia');// get name
$state->getName();// get nick name
$state->getNickName();// get official name
$state->getOfficialName();// get short code
$state->getShortCode();// get capital
$state->getCapital();// get geo political zone
$state->getGeoPoliticalZone();// get date created
$state->getDateCreated();// get population
$state->getPopulation();// get website
$state->getWebsite();// get logo
$state->getLogo();// get flag
$state->getFlag();// get languages
$state->getLanguages();// get LGAs
$state->getLgas();// get areas - villages, cities, and towns
$state->getAreas();
```**Display assets - logos and flags**
To display logos and flags of states, you can copy the assets to the `images` folder in the accessible location of your application.For example, if you are developing with laravel, copy:
- `resources/logos` to `public/images/logos`, and
- `resources/flags` to `public/images/flags`Then you can access the assets as follows:
- `/images/logos/abia.png`
- `/images/flags/abia.png`## To Do
- Populate areas (villages, cities, and towns) for most of the remaining states
## Sources
- [https://currentaffairs.ng/state/](https://currentaffairs.ng/state/)
- [https://en.wikipedia.org/wiki/States_of_Nigeria](https://en.wikipedia.org/wiki/States_of_Nigeria)
- [https://www.nipc.gov.ng/nigeria-states/abia-state/](https://www.nipc.gov.ng/nigeria-states/abia-state/)
- [https://en.wikipedia.org/wiki/List_of_nicknames_of_Nigerian_states](https://en.wikipedia.org/wiki/List_of_nicknames_of_Nigerian_states)
- [https://www.mindat.org/feature-8636368.html](https://www.mindat.org/feature-8636368.html)
- [https://en.wikipedia.org/wiki/List_of_villages_in_Osun_State](https://en.wikipedia.org/wiki/List_of_villages_in_Osun_State)