承接 josecaseiro/angolan-geo 相关项目开发

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

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

josecaseiro/angolan-geo

最新稳定版本:1.1.3

Composer 安装命令:

composer require josecaseiro/angolan-geo

包简介

The angolan-geo Composer package is crafted to streamline the process of building models for Provincia (Provinces) and Municipio (Municipalities) in PHP applications, specifically tailored to the unique geographical structure of Angola. This package is a valuable asset for developers working on proj

README 文档

README

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

AngolanGeo is a PHP Composer package that simplifies the process of creating and populating models for Provincia (Provinces) and Municipio (Municipalities) with accurate data of provinces and cities in Angola. This package is designed to seamlessly integrate with Laravel projects, providing an easy way to incorporate Angolan geographical information.

Installation

You can install the package via composer:

composer require josecaseiro/angolan-geo

After installing, you need to add the following line to the run method in your DatabaseSeeder file:

$this->call([ProvinciaSeeder::class]);

Your DatabaseSeeder under database\seeders should look like this:

<?php

namespace Database\Seeders;

use App\Models\User;
use Illuminate\Database\Seeder;
use Josecaseiro\AngolanGeo\Seeders\ProvinciaSeeder;

class DatabaseSeeder extends Seeder
{
    /**
     * Seed the application's database.
     */
    public function run(): void
    {
        $this->call([ProvinciaSeeder::class]);
    }
}

Finally execute commands to import all data to your database:

php artisan migrate

then

php artisan db:seed

Usage

use Josecaseiro\AngolanGeo\Models\Provincia;
use Josecaseiro\AngolanGeo\Models\Municipio;

// Get all Provinces
$provincias = Provincia::all();

// Get a Province by name
$province = Provincia::where('name', 'Luanda')->first();

// Get all Municipios
$municipios = Municipio::all();

// Get Municipios by a Province
$luanda = Provincia::where('name', 'Luanda')->first();
$municipiosLuanda = $luanda->municipios;


// From a Municipio you can get its Province
$municipio = Municipio::first();
$prov = $municipio->provincia;

Features

  • Easy Integration: Seamlessly integrate Provincia and Municipio models into your Laravel projects.
  • Data Accuracy: Utilize a reliable and regularly updated dataset of Angolan provinces and municipalities.
  • Efficient Model Population: Simplify the process of populating your models with pre-existing data.
  • Localization Support: The package aligns with Angola's administrative divisions, providing accurate localized data.

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security-related issues, please email jvcaseiro@hotmail.com instead of using the issue tracker.

Credits

License

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

统计信息

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

GitHub 信息

  • Stars: 10
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-02-15