devfaysal/laravel-bangladesh-geocode

0.4 2020-03-03 06:19 UTC

This package is auto-updated.

Last update: 2020-03-10 09:33:03 UTC


README

Division, District and Upazila data of Bangladesh for Laravel application. Migration and Seeds are ready. Just publish migrations and seeds and then migrate the db and run the seed command.

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

Latest Version on Packagist Build Status Quality Score Total Downloads

Installation

You can install the package via composer:

composer require devfaysal/laravel-bangladesh-geocode

Publish Migration and Seeds

php artisan vendor:publish --provider="Devfaysal\BangladeshGeocode\BangladeshGeocodeServiceProvider"

#If you need to overrride previously published migrationa and seeds
php artisan vendor:publish --provider="Devfaysal\BangladeshGeocode\BangladeshGeocodeServiceProvider" --force

php artisan migrate

composer dump-autoload

php artisan db:seed --class=DivisionSeeder
php artisan db:seed --class=DistrictSeeder
php artisan db:seed --class=UpazilaSeeder

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::find(1);
$districts = $division->districts;

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

//Use any Laravel model functions...

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

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.