vanthao03596 / laravel-hanhchinhvn
越南行政 Laravel
1.2.0
2022-03-04 04:26 UTC
Requires
- php: ^7.3 || ^8.0
- illuminate/database: ^6.0|^7.0|^8.0
- vanthao03596/laravel-package-tools: ^2.0
Requires (Dev)
- nunomaduro/collision: ^3.0|^5.3
- orchestra/testbench: ^4.8|^5.2|^6.0
- phpunit/phpunit: ^9.3
README
Laravel hcvn 包含越南所有城市、区和街道
安装
您可以通过 composer 安装此包
composer require vanthao03596/laravel-hanhchinhvn
使用方法
php artisan vendor:publish --provider="Vanthao03596\HCVN\HCVNServiceProvider"
php artisan migrate
php artisan hcvn:install
与模型一起工作
获取所有城市、区和街道
use Vanthao03596\HCVN\Models\Province; use Vanthao03596\HCVN\Models\District; use Vanthao03596\HCVN\Models\Ward; $cities = Province::get(); $districts = District::get(); $wards = Ward::get();
通过关系获取数据
use Vanthao03596\HCVN\Models\Province; $city = Province::first(); $districts = $city->districts; $wards = $city->wards;
所有数据来自: madnh/hanhchinhvn
测试
composer test
变更日志
请参阅 CHANGELOG 了解最近更改的详细信息。
贡献
请参阅 CONTRIBUTING 了解详情。
致谢
许可
MIT 许可证 (MIT)。请参阅 许可文件 了解更多信息。