vanthao03596 / laravel-hanhchinhvn
hành chính việt nam laravel
Installs: 4 363
Dependents: 0
Suggesters: 0
Security: 0
Stars: 39
Watchers: 2
Forks: 10
Open Issues: 0
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 contain all cities, districts, wards in vietnam
(Chú ý: Huyện Lý Sơn tỉnh Quảng Ngãi hiện chỉ còn cấp Huyện không có cấp xã )
Installation
You can install the package via composer:
composer require vanthao03596/laravel-hanhchinhvn
Usage
php artisan vendor:publish --provider="Vanthao03596\HCVN\HCVNServiceProvider"
php artisan migrate
php artisan hcvn:install
Working with Models
Get all cities, districts, wards
use Vanthao03596\HCVN\Models\Province; use Vanthao03596\HCVN\Models\District; use Vanthao03596\HCVN\Models\Ward; $cities = Province::get(); $districts = District::get(); $wards = Ward::get();
Get data via relationship
use Vanthao03596\HCVN\Models\Province; $city = Province::first(); $districts = $city->districts; $wards = $city->wards;
All data get from: madnh/hanhchinhvn
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.