fadlee/filament-indonesia-region-field 问题修复 & 功能扩展

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

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

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

  1. Import the IndonesiaRegionSelect component and RegionLevel enum in your Filament resource or form:
use Fadlee\FilamentIndonesiaRegionField\Forms\Components\IndonesiaRegionSelect;
use Fadlee\FilamentIndonesiaRegionField\Enums\RegionLevel;
  1. 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
        ]);
}
  1. 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_PROVINCE
  • RegionLevel::LEVEL_2_CITY
  • RegionLevel::LEVEL_3_DISTRICT
  • RegionLevel::LEVEL_4_VILLAGE
  1. 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:

  1. 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.

  2. Data Loading: Region data is loaded once and cached on the client side, making subsequent searches and filtering operations extremely fast.

  3. 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:

  1. Data Structure: Uses a comprehensive database of Indonesia administrative regions up to village level.

  2. Search Implementation: Implements client-side fuzzy search for better performance and user experience.

  3. 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 我们能提供哪些服务?
定制开发 / 二次开发

基于 fadlee/filament-indonesia-region-field 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: Blade

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-02-10