devfaysal/laravel-bangladesh-geocode

2.3.0 2024-11-06 09:38 UTC

This package is auto-updated.

Last update: 2024-11-06 09:43:49 UTC


README

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

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.