定制 josephmmendez/gazetteer 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

josephmmendez/gazetteer

Composer 安装命令:

composer require josephmmendez/gazetteer

包简介

A package build on Laravel 5 which provides a list of all the the Countries with their states and suburbs

README 文档

README

Latest Stable Version Total Downloads Latest Unstable Version License

A package build on Laravel 5 which provides a list of all the the Countries with their states and suburbs

Countries available right now:-

  • Australia
  • Maldives

Install

1- composer require josephmmendez/gazetteer

Open the file config\app.php

Add the following line to the providers array

Subbe\Gazetteer\GazetteerServiceProvider::class,

and this to the aliases array

'Gazetteer' => Subbe\Gazetteer\Facades\GazetteerFacade::class,

2- php artisan vendor:publish

Running this command will publish the migration and seed files to your application's 'migrations' and 'seeds' folder.

Update your DatabaseSeeder.php file found in your database/seeds folder and add the following to it.

  • $this->call(CountryTableSeeder::class);

  • $this->call(StateTableSeeder::class);

  • $this->call(SuburbTableSeeder::class);

  • $this->call(MaldiveIslandsTableSeeder::class);

Now run

3- composer dump-autload

4- php artisan migrate

This will add the 'countries', 'states', and 'suburbs' table to your database.

5- php artisan db:seed

Populate the tables created.

Usage

  • Gazetteer::countries() -> returns a collection of available countries
  • Gazetteer::countries($country_code) -> returns an instance of the requested country (searched by country code)
  • Gazetteer::countries($country_name) -> returns an instance of the requested country (searched by country name)
  • Gazetteer::states($country_code) -> returns a collection of states for a given country (searched by country code)
  • Gazetteer::states($country_name) -> returns a collection of states for a given country (searched by country name)
  • Gazetteer::suburbs($country, $states) -> returns a collection of states for a given country (searched by country name)
  • Gazetteer::suburb($input) -> returns an instance of a suburb for a given postcode (searched by postcode)
  • Gazetteer::suburb($input) -> returns an instance of a suburb for a given suburb name (searched by suburb name)

统计信息

  • 总下载量: 119
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-02-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固