emmadonjo/naija

Naija 是一个 PHP 包,提供了关于尼日利亚州、地方政府区域、城市和乡镇的数据。

v1.0.2 2024-09-25 11:28 UTC

This package is auto-updated.

Last update: 2024-09-25 11:29:32 UTC


README

Build Status Total Downloads Latest Stable Version License

Naija 是一个 PHP 包,提供了关于尼日利亚州、地方政府区域、城市和乡镇的数据。

此包受到了 https://github.com/Mercyware/Nigerian-States 的启发。

使用此包,您可以检索以下与州相关的信息

  • 名称
  • 首府
  • 政治区域
  • 成立日期
  • 人口 - 男女
  • 网站
  • 标志
  • 国旗
  • 昵称
  • 语言
  • 地方政府区域
  • 区域 - 村庄、城镇和城市

使用方法

通过以下方式安装

    composer require emmadonjo/naija
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();

显示资产 - 标志和国旗 要显示州的标志和国旗,您可以复制这些资产到应用程序可访问位置的 images 文件夹。

例如,如果您使用 laravel 进行开发,将

  • resources/logos 复制到 public/images/logos,并将
  • resources/flags 复制到 public/images/flags

然后您可以按如下方式访问这些资产

  • /images/logos/abia.png
  • /images/flags/abia.png

待办事项

  • 为大多数剩余的州填充区域(村庄、城镇和城市)

来源