承接 marshmallow/dataset-google-geotargets 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

marshmallow/dataset-google-geotargets

最新稳定版本:v1.2.0

Composer 安装命令:

composer require marshmallow/dataset-google-geotargets

包简介

Import all GeoTargets from Google into your Laravel project.

README 文档

README

alt text

Laravel Google Geo Targets

This dataset contains all the geo location from Google. We update the source when Google publishes a new one and you can reseed your data. By default only the Netherlands is imported but you can change this in the config if you want to.

Installatie

composer require marshmallow/dataset-google-geotargets

Migrate

Before you run the migration, please publish the migrations first.

php artisan vendor:publish --provider="Marshmallow\Datasets\GoogleGeoTargets\ServiceProvider" --tag="migrations"
```

Run `php artisan migrate` to create the database schema's.

# Publish the config

Publish the config so you are able to choose which countries will be seeded to the table and which data types will be seeded. By default this is set to The Nederlands and data types. If you want this to be seeded, you don't need to publish the config.

```bash
php artisan vendor:publish --provider="Marshmallow\Datasets\GoogleGeoTargets\ServiceProvider"
return [

	/**
	 * Specify the countries you wish to sync. An empty array will
	 * result in the seeder seeding all the data.
	 */
	'countries' => [
		'NL',
	],

	/**
	 * Specify the types you wish to sync.
	 */
	'types' => [
		GoogleGeoTarget::CITY,
		// ...
	]
];

Seed the table

We need to seed to tables, the country table and the Google Geo Target tables.

# Seed the country table.
php artisan db:seed --class="Marshmallow\Datasets\Country\Seeders\CountrySeeder"

# Seed the Google Geo Target table
php artisan db:seed --class="Marshmallow\Datasets\GoogleGeoTargets\Seeds\GoogleGeoTargetsSeeder"

Usage

$country = Country::alpha2('NL');
$country->provinces->first()->cities->first()->name;

Copyright (c) 2020 marshmallow

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-07-23