Skip to content

Thông tin phân cấp hành chính Việt Nam cho laravel

License

Notifications You must be signed in to change notification settings

trkien96/laravel-hanhchinhvn

 
 

Repository files navigation

Very short description of the package

Laravel hcvn contain all cities, districts, wards in vietnam

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.

About

Thông tin phân cấp hành chính Việt Nam cho laravel

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%