PHPackages                             alimranahmed/bdlocation - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. alimranahmed/bdlocation

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

alimranahmed/bdlocation
=======================

Locations of Bangladesh

1.0.8(6y ago)2519012MITPHPPHP ^7.1

Since Feb 12Pushed 6y ago3 watchersCompare

[ Source](https://github.com/alimranahmed/BDLocation)[ Packagist](https://packagist.org/packages/alimranahmed/bdlocation)[ RSS](/packages/alimranahmed-bdlocation/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (1)Versions (10)Used By (0)

[![Build Status](https://camo.githubusercontent.com/f80f59c2f9cb9345427c13f8e9bc32505e707ec47709a27c2a7a02e0d8147645/68747470733a2f2f7472617669732d63692e6f72672f616c696d72616e61686d65642f42444c6f636174696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/alimranahmed/BDLocation)[![License](https://camo.githubusercontent.com/250ec5c5b91bc5278245fc983f0334cae12bb0294fa57d7993a20d6787625f06/68747470733a2f2f706f7365722e707567782e6f72672f616c696d72616e61686d65642f62646c6f636174696f6e2f6c6963656e7365)](https://packagist.org/packages/alimranahmed/bdlocation)[![Latest Stable Version](https://camo.githubusercontent.com/871e3025ca2d1a5e14b346abd8eff9745bbcb75e93bc92f6a9a2d2e58b4963e6/68747470733a2f2f706f7365722e707567782e6f72672f616c696d72616e61686d65642f62646c6f636174696f6e2f762f737461626c65)](https://packagist.org/packages/alimranahmed/bdlocation)

BDLocation
==========

[](#bdlocation)

A PHP interface to access Locations of Bangladesh. The data in this project used and slightly modified from [Bangladesh-geolocation](https://github.com/nuhil/bangladesh-geocode)

Features
--------

[](#features)

1. Can access name, bengali\_name etc of divisions, districts, sub districts and unions of Bangladesh
2. Zero configurations

Requirements
------------

[](#requirements)

PHP &gt;= 7

Installation
------------

[](#installation)

Execute the following command in the terminal while you are in the root directory of your PHP project:

`composer require alimranahmed/bdlocation`

That's it! you are ready to go!

Usages
------

[](#usages)

Don't forget to use the BD class:

```
use BDLocation\BD;

```

To get all **divisions** of Bangladesh as an array of Location object:

```
BD::division()->all();

```

To get all **districts** of Bangladesh as an array of Location object:

```
BD::district()->all();

```

To get all **sub-districts/upazilas** of Bangladesh as an array of Location object:

```
BD::subDistrict()->all();

```

To get all **unions** of Bangladesh of Bangladesh as an array of Location object:

```
BD::union()->all();

```

To get all the districts of division that start with 5 character `chatt`(Chattogram), we can use the following code. Same thing will work for sub-disctrict and union. But in case of sub-district and union we need to pass `district` and `sub_district` respectively.

```
BD::district()->getWhere('division', 'chatt');
BD::subDistrict()->getWhere('district', 'brahm');
BD::union()->getWhere('sub_district', 'sarai');

```

To get the district that has name `Brahmanbaria` we can use the following code. Same thing will work for division, sub-district and union also. Insead of `name` we can pass `short_name`(first 3 letter of the location), `bengali_name` also.

```
BD::district()->getWhere('name', 'brahmanbaria');
or
BD::district()->getWhere('name', '=', 'brahmanbaria');

```

To get all the districts that contains the letter `rahman` in it's name we can use the following code. Same thing will work for division, sub-district and union also. Insead of `name` we can pass `short_name`(first 3 letter of the location), `bengali_name` also.

```
BD::district()->getWhere('name', 'like', 'rahman');

```

**Note:** We have only `=` and `like` as operator here. No other operator will work here.

Wishlist
--------

[](#wishlist)

- Supporting more operators like `like%` `%like` etc.

### Contribution

[](#contribution)

**Anyone is always welcome to contribute on the project. If you want to work with:**

1. Just create and issue(even if you want to fix the issue).
2. After fixing any issue or adding any new feature just send a pull request
3. I will be happy to add your code for the betterment of this project. Thanks.

Licence
-------

[](#licence)

[MIT](https://opensource.org/licenses/MIT)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 90.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~62 days

Recently: every ~25 days

Total

9

Last Release

2515d ago

PHP version history (2 changes)1.0.0PHP ^7.0

1.0.1PHP ^7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/b8c3fefb2074087ffdd55e9ebc7186a690d78ff1c23d059e6ccf68303eda0ad2?d=identicon)[al\_imran](/maintainers/al_imran)

---

Top Contributors

[![alimranahmed](https://avatars.githubusercontent.com/u/7629427?v=4)](https://github.com/alimranahmed "alimranahmed (47 commits)")[![baharam000](https://avatars.githubusercontent.com/u/638977?v=4)](https://github.com/baharam000 "baharam000 (4 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")

---

Tags

bangladesh-locationcomposerphp7

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/alimranahmed-bdlocation/health.svg)

```
[![Health](https://phpackages.com/badges/alimranahmed-bdlocation/health.svg)](https://phpackages.com/packages/alimranahmed-bdlocation)
```

###  Alternatives

[tuyakhov/yii2-youtube

Yii2 youtube extension

127.0k](/packages/tuyakhov-yii2-youtube)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
