Skip to content

dominosaurs/terloquent-id

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

38 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ‡ฎ๐Ÿ‡ฉ Terloquent ID

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 dominosaurs/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: ๐Ÿ‘‰ dominosaurs/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 dominosaurs/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 ๐Ÿ• dominosaurs

About

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

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages