Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
China Distpicker

China Distpicker Laravel Package

laravel-admin-ext/china-distpicker

Laravel Admin extension that adds a cascading China province, city, and district picker to forms. It provides an easy-to-use regional selector for Chinese addresses, with built-in province, city, and district data and seamless integration into laravel-admin.

View on GitHub
Deep Wiki
Context7

laravel-admin-ext/china-distpicker integrates a China province-city-district picker into Laravel Admin forms. It gives you a ready-made cascading selector for Chinese administrative regions, so you can bind a single field to a full three-level location without writing custom JavaScript.

The extension registers a form widget that loads region data on demand and stores the selected value as text. Ideal for addresses, shipping details, and user profiles in admin panels.

  • Three-level cascading selection — province, city, and district
  • Seamless Laravel Admin integration — works with existing form fields
  • Zero-configuration data — region data bundled with the package
  • Lightweight JavaScript — fetch-on-demand, no heavy dependencies
  • Simple API — one line to add to any form
Frequently asked questions about China Distpicker
How do I install laravel-admin-ext/china-distpicker in a Laravel Admin project?
Run composer require laravel-admin-ext/china-distpicker, then use the distpicker field on the laravel-admin Form builder. The package is a form-field extension rather than a general-purpose Laravel package, so there is no meaningful service provider, database schema, or API to configure. You should still verify that the bundled JavaScript asset is published or served from your own application origin.
Does china-distpicker support Laravel 10 or Laravel 11?
The package targets laravel-admin 1.8+ with Laravel 5.5 through 9 and PHP 7.4 through 8.1. Laravel 10 and 11 are only reachable through a community laravel-admin fork, so compatibility must be verified against that fork before you rely on it. The highest risk is being blocked from a Laravel upgrade by the admin panel itself.
Is there a server-side validation rule for the province, city, and district combination?
No, the package does not ship a Laravel validation rule for the three-column combination. The widget only constrains input in the browser, and nothing stops an invalid province, city, and district combination from being POSTed or written by an API client. You must add your own server-side validation if the stored address is used for shipping, tax, or routing logic.
How do I add a province-city-district cascading selector to a laravel-admin form?
Use the distpicker field on the Form builder with the names of your address columns, for example $form->distpicker(['province', 'city', 'district']). It renders a three-level cascading province, city, and district selector backed by a bundled static JavaScript dataset. The selected values are submitted as separate form fields, so your model and validation rules need to handle each column.
How current is the bundled China administrative division dataset?
The last release appears to date from around October 2021, so the bundled statistical division codes almost certainly predate several county-level city to district conversions and new districts created since 2020. China's administrative divisions are revised annually, and stale options can cause operators to pick wrong codes that propagate into shipping and tax logic. Ask the maintainer which year the dataset reflects and whether a regeneration script against an official source exists.
Can I use this package with Filament, Nova, or Livewire?
No, it is specifically a laravel-admin form-field extension and will not integrate with Filament, Nova, Livewire, Inertia, or a custom SPA. The PHP wrapper is inert outside laravel-admin, so only the underlying JavaScript dataset is reusable in another stack. For other admin panels you would need to build your own field around a compatible China district picker.
Will the distpicker JavaScript work with a strict CSP or an offline admin panel?
That depends on whether the assets are vendored and published to your application origin or fetched from a CDN at runtime. CDN loading collides with strict Content Security Policy rules, offline admin environments, and data-residency review for China-hosted deployments. Verify the asset delivery posture and self-host the JavaScript if necessary.
Does it support fourth-level street or township selection?
No, the field is limited to three levels: province, city, and district or county. It does not provide fourth-level street or township selection, and it does not expose urban-rural classification data that logistics routing often needs. If your address requirements go deeper than county level, you will need a different data source or a custom extension.
What license applies to the package and the bundled distpicker data?
The laravel-admin wrapper is MIT licensed, but the provenance and license of the bundled distpicker JavaScript and the administrative division data are often unclear. China administrative division data is frequently derived from sources that carry their own terms. Review the license and provenance before redistributing the assets or shipping them in a commercial product.
Is laravel-admin-ext/china-distpicker still maintained?
There has been no release in roughly two and a half years, and there is no visible PHP 8.2 or 8.3 CI or CVE cadence. Because laravel-admin itself is in maintenance mode, this package sits on a decaying dependency chain. If you depend on it long term, plan to fork it, refresh the dataset, and take ownership of compatibility testing.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core