buchin/indodata

Data Provinsi-Kota-Kecamatan-Kabupaten se Indonesia memakai PHP

dev-master 2016-12-04 06:20 UTC

This package is auto-updated.

Last update: 2024-04-15 17:26:08 UTC


README

Database apa saja yang berhubungan dengan indonesia. Memakai Eloquent Model sehingga mendukung relationship Has Many dan Belongs to.

Instalasi dengan Composer

composer require buchin/indodata

Contoh Penggunaan

use Buchin\Indodata\Province;
use Buchin\Indodata\City;
use Buchin\Indodata\District;
use Buchin\Indodata\Village;

// Initialize Capsule. Required to initialize DB connection.
$capsule = new Capsule;


// Relationship: Belongs To
// Get village
$village = Village::first();

// Get district
$district = $village->district;

// Get City
$city = $district->city;

// Get Province
$province = $city->province();

// Chainable
$province = $village->district->city->province;