2017 © Pedro Peláez
 

library region

image

cblink/region

  • Thursday, April 19, 2018
  • by hanson
  • Repository
  • 1 Watchers
  • 77 Stars
  • 356 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 12 Forks
  • 3 Open issues
  • 5 Versions
  • 92 % Grown

The README.md

region

省市区联动数据, (*1)

安装

composer require cblink/region, (*2)

在 app.php 中加入服务提供者, (*3)

/*
 * Package Service Providers...
 */
Cblink\Region\RegionServiceProvider::class,

生成 migration 文件, (*4)

php artisan vendor:publish --provider="Cblink\Region\RegionServiceProvider", (*5)

2018_01_01_000000_create_regions_table.php 可以根据自身需求与结构修改表名或字段名, (*6)

执行迁移, (*7)

php artisan migrate, (*8)

默认方法

use Cblink\Region\Region;

$region = new Region();

$region->allProvinces(); // 全部省份
$region->allCities(); // 全部城市
$region->allAreas(); // 全部区
$region->nest($id = null); // 展示全部子区域,可指定某个省或市id
$region->nestFromChild($id); // 根据市或区id展示其所有父结构

The Versions

19/04 2018

dev-master

9999999-dev

  Sources   Download

MIT

The Development Requires

by Avatar hanson

19/04 2018

1.0.3

1.0.3.0

  Sources   Download

MIT

The Development Requires

by Avatar hanson

18/04 2018

1.0.2

1.0.2.0

  Sources   Download

MIT

The Development Requires

by Avatar hanson

04/04 2018

1.0.1

1.0.1.0

  Sources   Download

MIT

The Development Requires

by Avatar hanson

02/04 2018

1.0.0

1.0.0.0

  Sources   Download

MIT

The Development Requires

by Avatar hanson