2017 © Pedro Peláez
 

library bdlocation

Locations of Bangladesh

image

alimranahmed/bdlocation

Locations of Bangladesh

  • Wednesday, February 14, 2018
  • by al_imran
  • Repository
  • 4 Watchers
  • 10 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 11 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Build Status License Latest Stable Version, (*1)

BDLocation

A PHP interface to access Locations of Bangladesh. The data in this project used and slightly modified from Bangladesh-geolocation, (*2)

Features

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

Requirements

PHP >= 7, (*3)

Installation

Execute the following command in the terminal while you are in the root directory of your PHP project:, (*4)

composer require alimranahmed/bdlocation, (*5)

That's it! you are ready to go!, (*6)

Usages

Don't forget to use the BD class:, (*7)

use BDLocation\BD;

To get all divisions of Bangladesh as an array of Location object:, (*8)

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

To get all districts of Bangladesh as an array of Location object:, (*9)

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

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

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

To get all unions of Bangladesh of Bangladesh as an array of Location object:, (*11)

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., (*12)

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., (*13)

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., (*14)

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

Note: We have only = and like as operator here. No other operator will work here., (*15)

Wishlist

  • [x] Supporting more operators like like% %like etc.

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., (*16)

Licence

MIT, (*17)

The Versions

14/02 2018

dev-master

9999999-dev

Locations of Bangladesh

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Al- Imran Ahmed