dev-master
9999999-devLocations of Bangladesh
MIT
The Requires
- php ^7.0
The Development Requires
by Al- Imran Ahmed
Wallogit.com
2017 © Pedro Peláez
Locations of Bangladesh
A PHP interface to access Locations of Bangladesh. The data in this project used and slightly modified from Bangladesh-geolocation, (*2)
PHP >= 7, (*3)
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)
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)
like% %like etc. 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)
MIT, (*17)
Locations of Bangladesh
MIT