uatthaphon/laravel-thai-address 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

uatthaphon/laravel-thai-address

最新稳定版本:0.1.3

Composer 安装命令:

composer require uatthaphon/laravel-thai-address

包简介

Thai provincial database with latitude and longitude.

README 文档

README

Thai provincial database with latitude and longitude.

Setup

Add package dependency to your project

composer require uatthaphon/laravel-thai-address

Before Laravel 5.5, add package's service provider to your project's config/app.php

'providers' => [
  ...

  Uatthaphon\ThaiAddress\ThaiAddressServiceProvider::class,
],

Run publishing to publish 3 tagging => migrations csv seeds

php artisan vendor:publish

After all has been published you can create tables by running the migrations

php artisan migrate

Then run seeder, it will grab csv and fill them into each tables

php artisan db:seed --class=ThailandAddressSeeder

Usage

You can use available models for thai address tables

use Uatthaphon\ThaiAddress\Models\ThailandProvince;
use Uatthaphon\ThaiAddress\Models\ThailandDistrict;
use Uatthaphon\ThaiAddress\Models\ThailandSubdistrict;

...

/**
 * Available Relationships
 */

// list all districts under the province
app(ThailandProvince::class)->find(1)->districts()->get();

// get province of the district
app(ThailandDistrict::class)->find(1)->province;
// list all sub districtes under the district
app(ThailandDistrict::class)->find(1)->subdistricts()->get();

// get district of the subdistrict
app(ThailandSubdistrict::class)->find(1)->district;
// get province of the subdistrict
app(ThailandSubdistrict::class)->find(1)->province;

Credits

This project wouldn't exist without the awesome database source by aaronamm/thai-administrative-division-province-district-subdistrict-sql

统计信息

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

GitHub 信息

  • Stars: 5
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-02-03