2017 © Pedro Peláez
 

library laravel-thai-address

Thai provincial database with latitude and longitude.

image

uatthaphon/laravel-thai-address

Thai provincial database with latitude and longitude.

  • Monday, February 5, 2018
  • by uatthaphon
  • Repository
  • 1 Watchers
  • 2 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 33 % Grown

The README.md

laravel-thai-address

Thai provincial database with latitude and longitude., (*1)

Setup

Add package dependency to your project, (*2)

composer require uatthaphon/laravel-thai-address

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

'providers' => [
  ...

  Uatthaphon\ThaiAddress\ThaiAddressServiceProvider::class,
],

Run publishing to publish 3 tagging => migrations csv seeds, (*4)

php artisan vendor:publish

After all has been published you can create tables by running the migrations, (*5)

php artisan migrate

Then run seeder, it will grab csv and fill them into each tables, (*6)

php artisan db:seed --class=ThailandAddressSeeder

Usage

You can use available models for thai address tables, (*7)

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, (*8)

The Versions

05/02 2018

dev-master

9999999-dev

Thai provincial database with latitude and longitude.

  Sources   Download

MIT

The Requires

  • php >=5.6.4

 

The Development Requires

laravel thai address

05/02 2018

0.1.3

0.1.3.0

Thai provincial database with latitude and longitude.

  Sources   Download

MIT

The Requires

  • php >=5.6.4

 

The Development Requires

laravel thai address

05/02 2018

0.1.2

0.1.2.0

Thai provincial database with latitude and longitude.

  Sources   Download

MIT

The Requires

  • php >=5.6.4

 

The Development Requires

laravel thai address

03/02 2018

0.1.1

0.1.1.0

Thai provincial database with latitude and longitude.

  Sources   Download

MIT

The Requires

  • php >=5.6.4

 

The Development Requires

laravel thai address

03/02 2018

0.0.1

0.0.1.0

Thai provincial database with latitude and longitude.

  Sources   Download

MIT

The Requires

  • php >=5.6.4

 

The Development Requires

laravel thai address

03/02 2018

0.1.0

0.1.0.0

Thai provincial database with latitude and longitude.

  Sources   Download

MIT

The Requires

  • php >=5.6.4

 

The Development Requires

laravel thai address