๐ŸŒ Eloquent models for Indonesian administrative regions โ€” no database required.

Installs: 5

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/terloquent/id

v0.0.1 2025-10-17 22:26 UTC

This package is auto-updated.

Last update: 2025-10-17 22:29:10 UTC


README

License: MIT Packagist Version

Eloquent models for Indonesian administrative regions โ€” no database required.

Powered by Sushi, Terloquent ID lets you query provinces, regencies/cities, districts, and villages instantly โ€” without any migrations or seeders.

โœจ Features

  • ๐Ÿ‡ฎ๐Ÿ‡ฉ Ready-to-use Indonesian administrative data: Province, Regency, District, Village
  • โšก Works like standard Eloquent models (where, first, whereLike, etc.)
  • ๐Ÿง  No migrations or seeding required
  • ๐Ÿ—ƒ๏ธ Auto-cached via Sushi for fast performance
  • ๐Ÿ“ฆ Uses external CSV data from sensasi-delight/id-administrative-divisions

๐Ÿš€ Installation

composer require terloquent/id

Requires the pdo_sqlite PHP extension.

Start using it right away:

use TerloquentID\Regency;

$regency = Regency::whereLike('name', '%Samarinda%')->firstOrFail();

No setup. No migrations. No database.

๐Ÿงฉ Data Source

The administrative data is sourced from the open dataset repository: ๐Ÿ‘‰ sensasi-delight/id-administrative-divisions

This repository provides CSV files representing Indonesiaโ€™s full administrative hierarchy:

Province โ†’ Regency โ†’ District โ†’ Village

It may also include additional metadata such as:

  • Official region codes (Kemendagri / BPS)
  • Coordinates (latitude, longitude)
  • Postal codes
  • Other optional attributes

Users cannot modify the data at runtime. To suggest updates or corrections, please open a pull request to sensasi-delight/id-administrative-divisions.

โš™๏ธ Under the Hood

  • Built on Sushi, which loads CSV data into an in-memory SQLite cache.
  • Relationships mirror the Indonesian hierarchy: Province โ†’ Regency โ†’ District โ†’ Village

๐Ÿ› ๏ธ Artisan Commands

TerloquentID provides a few handy Artisan commands to help you manage local administrative data:

Command Description
php artisan terloquent:status ๐Ÿ“Š Show the current status of the administrative data (path, last update, commit info, etc.)
php artisan terloquent:clear ๐Ÿงน Clear all locally stored data and cache.

๐Ÿ‘ฅ Perfect For

  • Laravel developers building Indonesia-focused applications
  • Address forms, location filters, or dashboards
  • Projects that need regional data without managing a database

โค๏ธ Acknowledgements

Made with โค๏ธ by ๐Ÿ• sensasi-delight