fadlee/filament-indonesia-region-field
Composer 安装命令:
composer require fadlee/filament-indonesia-region-field
包简介
Indonesia Region Field for Filament
README 文档
README
A custom form field component for Filament PHP that adds Indonesia region selection capabilities to your forms. This package provides a single select input field that can handle 4 levels of Indonesia administrative regions (Province, Regency/City, District, and Village).
Features
- Seamless integration with Filament forms
- Single input field for selecting Indonesia regions
- Support for 4 administrative levels:
- Province (Provinsi)
- Regency/City (Kabupaten/Kota)
- District (Kecamatan)
- Village (Desa/Kelurahan)
- Client-side fuzzy search for better performance
- No additional server requests for searching
- Extends Filament's native select component
Requirements
- PHP 8.1 or higher
- Laravel 10.0 or higher
- Filament 3.x
Installation
You can install the package via composer:
composer require fadlee/filament-indonesia-region-field
Usage
- Import the IndonesiaRegionSelect component and RegionLevel enum in your Filament resource or form:
use Fadlee\FilamentIndonesiaRegionField\Forms\Components\IndonesiaRegionSelect; use Fadlee\FilamentIndonesiaRegionField\Enums\RegionLevel;
- Add the field to your form:
public static function form(Form $form): Form { return $form ->schema([ IndonesiaRegionSelect::make('region') ->label('Region') ->placeholder('Select region...'), // ... other fields ]); }
- Using with specific level:
public static function form(Form $form): Form { return $form ->schema([ IndonesiaRegionSelect::make('region') ->label('Region') ->level(RegionLevel::LEVEL_3_DISTRICT) ->placeholder('Select district...'), ]); }
Available levels:
RegionLevel::LEVEL_1_PROVINCERegionLevel::LEVEL_2_CITYRegionLevel::LEVEL_3_DISTRICTRegionLevel::LEVEL_4_VILLAGE
- Using in Filament action modals:
use Filament\Actions\Action; public static function getActions(): array { return [ Action::make('selectRegion') ->form([ IndonesiaRegionSelect::make('region') ->label('Select Region') ->required(), ]) ->action(function (array $data) { // Process the selected region // $data['region'] contains the selected region code }), ]; }
How it Works
The package extends Filament's native select component to provide a seamless Indonesia region selection experience. Key features include:
-
Client-side Search: All searching is performed on the client side using fuzzy search, eliminating the need for additional server requests and providing instant feedback.
-
Data Loading: Region data is loaded once and cached on the client side, making subsequent searches and filtering operations extremely fast.
-
User Experience: The component provides immediate response to user input since all operations are performed locally in the browser.
Technical Implementation
The Indonesia region selector is built on top of Filament's select component with these enhancements:
-
Data Structure: Uses a comprehensive database of Indonesia administrative regions up to village level.
-
Search Implementation: Implements client-side fuzzy search for better performance and user experience.
-
Value Management: Handles the storage and retrieval of region codes while displaying human-readable region names in the interface.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This package is open-sourced software licensed under the MIT license.
fadlee/filament-indonesia-region-field 适用场景与选型建议
fadlee/filament-indonesia-region-field 是一款 基于 Blade 开发的 Composer 扩展包,目前已累计 151 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 02 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「filament」 「filament-plugin」 「form-field」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 fadlee/filament-indonesia-region-field 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 fadlee/filament-indonesia-region-field 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 fadlee/filament-indonesia-region-field 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
jitone-ai is a powerful FilamentPHP plugin that integrates AI-powered features directly into your Filament forms.
Send Notification to discord channel Webhook using native FilamentPHP Notification Facade class
QR code scanner for Filament
A Slick Slider for your filament v3 forms.
A Filament v3 form field that integrates TinyMCE 8 rich text editor with dark mode, profiles, and file browser support.
Pikaday date picker field for FilamentPHP — lightweight, dependency-light date input with min/max dates, year range, first-day-of-week, and full i18n.
统计信息
- 总下载量: 151
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-10