terloquent / id
๐ 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
Requires
- calebporzio/sushi: ^2.5
- illuminate/console: ^10.0 || ^11.0 || ^12.0
- illuminate/database: ^10.0 || ^11.0 || ^12.0
- illuminate/support: ^10.0 || ^11.0 || ^12.0
Requires (Dev)
- laravel/pint: ^1.25
- phpstan/phpstan: ^2.1
README
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
- Caleb Porzio โ Sushi
- All contributors to sensasi-delight/id-administrative-divisions
Made with โค๏ธ by ๐ sensasi-delight