sandofvega/bdgeocode 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sandofvega/bdgeocode

最新稳定版本:v2.0.4

Composer 安装命令:

composer require sandofvega/bdgeocode

包简介

8 Division, 64 District, 491 Thana and 2350 Union fully mapped laravel package.

README 文档

README

Latest Stable Version Total Downloads License Twitter Follow

8 Division, 64 District, 491 Thana and 4541 Union fully mapped laravel package. Easy to install & config. All data is accessible from database using laravel eloquent ORM.

All information, content, and spelling have been taken from https://bangladesh.gov.bd

Contents

Installation

In order to install Bdgeocode, just run this command in your project:

composer require sandofvega/bdgeocode

Configuration

  1. Publish models and migration file:
php artisan vendor:publish --provider="Sandofvega\Bdgeocode\BdgeocodeServiceProvider"
  1. Run artisan migrate command:
php artisan migrate

After the migration, four new tables will be present:

  • divisions
  • districts
  • thanas
  • unions
  1. Add Bdgeocode's seeder class to database/seeds/DatabaseSeeder.php:
use Sandofvega\Bdgeocode\Seeds\BdgeocodeSeeder;

class DatabaseSeeder extends Seeder
{
    public function run()
    {
        $this->call(BdgeocodeSeeder::class);
        //
    }
}

Now you are ready. When you run the seed command (e.g. db:seed or migrate:fresh --seed) the Bdgeocode's data will be inserted into your database.

Usage

You can get all data by using those models. E.g:

use App\District;

$districts = District::all();

There are relations bitween models. E. g:

use App\District;

$district = District::first(); // A district

$division = $district->division // Division for a district

$thanas = $district->thanas // All thana in a district
  • Note: There is one division for a district so the relation name is division(singular), not divisions. And there are many thanas in a district so the relation name is thanas(plural), not thana. You must follow this rule to call every relation.

License

Laravel Bangladesh Geocode is free software distributed under the terms of the MIT license.

Contribution guidelines

We follow PSR-2 and PSR-4 PHP coding standards and Semantic Versioning.

Please report any issue you find. And pull requests are welcome.

统计信息

  • 总下载量: 355
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 22
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 22
  • Watchers: 1
  • Forks: 13
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-09-06