devfaysal / laravel-bangladesh-geocode

Division, District and Upazila data of Bangladesh for Laravel application (5.5 and above)
MIT License
65 stars 24 forks source link

Bangladesh Geocode

Division, District, Upazila and Union data of Bangladesh for Laravel application. One artisan command and you are all set.

Do not hesitate to share your thought, create issue or send pull request.

Latest Version on Packagist Quality Score Total Downloads

Laravel Version Compatibility

Laravel Package
5.5.x 0.4.x
5.6.x 0.4.x
5.7.x 0.4.x
5.8.x 0.4.x
6.x.x 0.4.x
7.x.x 0.4.x
8.x.x 1.0.x
9.x.x 2.x.x
10.x.x 2.x.x
11.x.x 2.x.x

Update (New Upazila and Union added in v2.3.0)

Run this command to add new records to existing application safely

php artisan BangladeshGeocode:addnew

Installation

You can install the package via composer:

composer require devfaysal/laravel-bangladesh-geocode

Setup everything with just running one artisan command

php artisan BangladeshGeocode:setup

Usage

use Devfaysal\BangladeshGeocode\Models\Division;
use Devfaysal\BangladeshGeocode\Models\District;
use Devfaysal\BangladeshGeocode\Models\Upazila;

$divisions = Division::all();
$districts = District::all();
$upazilas = Upazila::all();

$division = Division::where('name', 'Dhaka');
$allDistrictsOfDhaka = $division->districts;

$division = Division::find(1);
$districts = $division->districts;

$district = District::find(1);
$upazilas = $district->upazilas;

//Use any Laravel (eluquent) model functions...

Testing

The package is well supported by automated test.

composer test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email devfaysal@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.