harrym/indonesian-regions 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

harrym/indonesian-regions

最新稳定版本:2.0.0

Composer 安装命令:

composer require harrym/indonesian-regions

包简介

Indonesian Region Database for Laravel

README 文档

README

Latest Version on Packagist Total Downloads License

A fast, lightweight, and modern Indonesian Region Database (Provinsi, Kota/Kabupaten, Kecamatan, Kelurahan/Desa) package for Laravel.

Installation

You can install the package via composer:

composer require harrym/indonesian-regions

After installation, publish the database migrations and configuration:

php artisan vendor:publish --provider="HarryM\IndonesianRegions\IndonesianRegionsServiceProvider"

Then run the migrations to create the required tables:

php artisan migrate

Finally, seed the regions database (this process handles bulk upserts securely and efficiently):

php artisan db:seed --class="HarryM\IndonesianRegions\Database\Seeders\RegionSeeder"

Structure

The provided datasets contain data mapped into four levels of regions:

  • AreaProvince (Provinces)
  • AreaCity (Cities & Regencies / Kota & Kabupaten)
  • AreaDistrict (Districts / Kecamatan)
  • AreaSubdistrict (Subdistricts & Villages / Kelurahan & Desa)

Usage

All Area models use Laravel's standard Eloquent system. You can interact with them statically or via relationships:

use HarryM\IndonesianRegions\Models\AreaProvince;
use HarryM\IndonesianRegions\Models\AreaCity;

// Get all provinces
$provinces = AreaProvince::all();

// Get the cities of a specific province using relationship
$province = AreaProvince::where('name', 'DKI JAKARTA')->first();
$jakartaCities = $province->cities;

// Get the district associated with a city
$city = AreaCity::where('name', 'KOTA JAKARTA SELATAN')->first();
$districts = $city->districts;

// Get subdistricts of a specific district
$district = $city->districts()->first();
$subdistricts = $district->subdistricts;

Testing

composer test

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 62
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 6
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固