teguh02/php_indonesia_region

Indonesia National Region PHP API no need database required

v1.0 2023-04-08 22:35 UTC

This package is auto-updated.

Last update: 2024-10-09 01:55:43 UTC


README

Why this package? Because this is no need to use database, just use this package and you can get all region in Indonesia

Install

Install with composer command

composer require teguh02/php_indonesia_region

Usage

PROVINCE

Get all province

$province = Region::query("all provinces") -> get();

Get a province by id

$province = Region::query("province with id = 36") -> get();

Get a province with array id

$province = Region::query("provinces with id in array [36, 51, 34, 61, 71]") -> get();

REGENCY

Get all regency with id province is 36

$regencies = Region::query("regencies with id_province = 33") -> get();

Get all regency with id province is 32, 33

$regencies = Region::query("regencies with id_province in array [32, 33]") -> get();

DISTRICT

Get all district with id regency is 3201

$districts = Region::query("districts with id_regency = 3302") -> get();

VILLAGE

get all village with id district is 330227

$villages = Region::query("villages with id_district = 330227") -> get();