codexwp/address
最新稳定版本:1.1.5
Composer 安装命令:
composer create-project codexwp/address
包简介
A simple package for managing address (zip code, prefecture, city, town etc).
README 文档
README
A simple laravel package for managing address like prefecture, city, town and postal code for Japan. And divisions, districts and upazilas for Bangladesh. (jQuery is required for html integration)
Supported Countries
- Japan
- Bangladesh
Installation
1. Using Composer
Run the following commands-
composer require "codexwp/address"
php artisan cwp:address_install --country={all/jp/bd}
2. Using Package
At first, create a folder like "packages" in your project. Then you can create sub folder like "packages/codexwp/address". Then put "src" folder of this package.
Secondly, update your project composer.json file like the following
"autoload": { "psr-4": { "Cwp\\Address\\" : "packages/codexwp/address/src" } },
Thirdly, open config/app.php file and add the following lines to the provider section
\Cwp\Address\Providers\AddressProvider::class,
Finally, discover and install the package.
composer dump-autoload
php artisan cwp:address_install --country={all/jp/bd}
Available APIs
//Japan
1. / address_api / jp / {code} / location
2. / address_api / jp / {code} / location_list
3. / address_api / jp / prefectures
4. / address_api / jp / {pref_name} / cities
5. / address_api / jp / {pref} / {city_name} / towns
6. / address_api / jp /{pref} / {city} / {town} /code
//Bangladesh
1. / address_api / bd / divisions
2. / address_api / bd / {division_name} / districts
3. / address_api / bd / {division_name} / {district_name} / upazilas
Usages
Library Service
You can use the available methods in your laravel project. Just call the class and method from your controller.
JP - "/src/Library/JpAddressService.php"
BD - "/src/Library/BdAddressService.php"
Html Integration
Auto update select list(cities) after change of another select input (prefecture).
-
Copy and include the "src/resources/js/address.js" file in html page.
-
Check the example code in "example" folder
统计信息
- 总下载量: 22
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-01-18