raiolanetworks/atlas 问题修复 & 功能扩展

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

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

raiolanetworks/atlas

最新稳定版本:2.0.0

Composer 安装命令:

composer require raiolanetworks/atlas

包简介

Get the data from the most recondite place with 'Atlas'

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

With 'Atlas' you will be able to create new tables in the database and fill them with information about countries, states, cities, timezones and more.

Requirements

  • PHP 8.3+
  • Laravel 11+

Get to know us

Installation

Install the package via Composer:

composer require raiolanetworks/atlas

Optionally publish the config file to customise table names or toggle entities:

php artisan vendor:publish --tag="atlas-config"

Run the migrations and seed the database:

php artisan atlas:install

The command will migrate the tables for every entity enabled in config('atlas.entities') (all enabled by default) and let you choose which seeders to run. The process may take a few minutes due to the large number of cities.

To re-seed the data after a package upgrade:

php artisan atlas:update

Other publishable resources

php artisan vendor:publish --tag="atlas-translations"
php artisan vendor:publish --tag="atlas-jsons"        # JSON data files (for overriding)

Note: Migrations are auto-loaded by the package. Do not publish them with --tag="atlas-migrations" unless you have a specific reason — published copies will cause "table already exists" errors.

Usage

Internally, the package works with Laravel models, which allows you to work with this model as if they were models of your own project.

For example, if you want to get all the countries in Africa:

use Raiolanetworks\Atlas\Models\Country;

class MyClass
{
	public function getAllAfricaCountries(): Collection
	{
		return Country::where('region_name', 'Africa')
			->orderBy('name')
			->get();
	}
}

Upgrading

If you are upgrading from 1.x, please see UPGRADE.md for a list of breaking changes and migration steps.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-03-19