Download the PHP package ajangsupardi/laravel-postcode-id without Composer
On this page you can find all versions of the php package ajangsupardi/laravel-postcode-id. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ajangsupardi/laravel-postcode-id
More information about ajangsupardi/laravel-postcode-id
Files in ajangsupardi/laravel-postcode-id
Package laravel-postcode-id
Short Description Laravel package for seeding Indonesian address data (provinces, regencies, districts, villages) with postal codes from Pos Indonesia
License MIT
Informations about the package laravel-postcode-id
Laravel Postcode ID
Laravel package for Indonesian address data with postal codes — downloaded fresh from Pos Indonesia.
Features
- Postal code lookup — Query villages by postal code with full address hierarchy
- Fresh data — Downloads directly from Pos Indonesia, not static dumps
- Idempotent seeders — Safe to run multiple times without duplicates
- Hierarchical parsing — Province → Regency → District → Village with name normalization
- Custom models — Extend default models or use your own
- Laravel 11, 12, 13 — Modern PHP 8.3+
Installation
Publish Configuration (optional)
Publish Migrations (optional)
Note: Migrations are automatically loaded by the service provider, so publishing is only needed if you want to modify the table structure.
Usage
1. Download Postcode Data
This command will download all postcode data from Pos Indonesia and save it as a CSV file.
2. Run Migrations & Seeder
Or add it to your DatabaseSeeder.php:
3. Auto-download & Seed
If you want to combine download and seed in a single step, you can call the download command before the seeder:
Postal Code Lookup
The main feature — find any Indonesian address by postal code:
Database Tables
This package creates 4 tables:
| Table | Description |
|---|---|
provinces |
Province data (id, name, code) |
regencies |
Regency/city data (id, province_id, name) |
districts |
District/sub-district data (id, regency_id, name) |
villages |
Village data (id, district_id, name, postal_code) |
Configuration
Edit config/postcode.php:
Custom Models
You can extend the default models to add columns or relationships:
Then update the configuration:
Table Prefix
If you want to use a prefix for your tables:
This will create tables: postcode_provinces, postcode_regencies, postcode_districts, postcode_villages.
Example Queries
Requirements
- PHP ^8.3
- Laravel ^11.0 / ^12.0 / ^13.0
Changelog
v1.1.6
- Fix progress bar not displaying in terminal during
postcode:seed
v1.1.5
- Fix
postcode:seedhanging on PostgreSQL — remove transaction wrapper that caused deadlock
v1.1.4
- Fix
postcode:seedhanging indefinitely — useArtisan::call()instead ofCommand::call()to correctly invoke seeder
v1.1.3
- Add progress bar to all seeders for visual feedback during bulk operations
v1.1.2
- Fix
postcode:downloadfailing on transient network errors — retry now handles cURL connection exceptions
v1.1.1
- Fix
VillageSeederhanging/timing out on PostgreSQL — foreign key triggers are temporarily disabled during bulk insert
v1.1.0
- Added
postcode:seedartisan command to fix shell escaping bug on Linux
v1.0.0
- Initial release — download, parse, and seed Indonesian address data with postal codes
License
MIT License. See LICENSE for more information.
All versions of laravel-postcode-id with dependencies
illuminate/console Version ^11.0|^12.0|^13.0
illuminate/database Version ^11.0|^12.0|^13.0
illuminate/http Version ^11.0|^12.0|^13.0
illuminate/support Version ^11.0|^12.0|^13.0