https://github.com/buchin/indodata
Data Provinsi-Kota-Kecamatan-Kabupaten se Indonesia memakai PHP
https://github.com/buchin/indodata
Last synced: 5 months ago
JSON representation
Data Provinsi-Kota-Kecamatan-Kabupaten se Indonesia memakai PHP
- Host: GitHub
- URL: https://github.com/buchin/indodata
- Owner: buchin
- Created: 2016-12-02T03:40:11.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-04T06:21:03.000Z (over 9 years ago)
- Last Synced: 2026-01-11T17:23:51.125Z (5 months ago)
- Language: PHP
- Homepage:
- Size: 1.38 MB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Tentang Indo Data
Database apa saja yang berhubungan dengan indonesia. Memakai Eloquent Model sehingga mendukung relationship Has Many dan Belongs to.
## Instalasi dengan Composer
```bash
composer require buchin/indodata
```
## Contoh Penggunaan
```php
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;
```