定制 luiscamp/laravel-peru-ubigeo 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

luiscamp/laravel-peru-ubigeo

最新稳定版本:v0.1.2

Composer 安装命令:

composer require luiscamp/laravel-peru-ubigeo

包简介

Peruvian ubigeo utilities for Laravel applications.

README 文档

README

Base package to work with Peruvian ubigeo data in Laravel.

Installation

composer require luiscamp/laravel-peru-ubigeo

Quick start after install

# 1) Publish migration
php artisan vendor:publish --tag=ubigeo-migrations

# 2) Run migrations
php artisan migrate

# 3) Publish seeder
php artisan vendor:publish --tag=ubigeo-seeders

# 4) Seed ubigeo data
php artisan db:seed --class="Database\\Seeders\\UbigeoSeeder"

Publish config

php artisan vendor:publish --tag=ubigeo-config

Publish migrations

php artisan vendor:publish --tag=ubigeo-migrations
php artisan migrate

Publish model + migration (single command)

php artisan ubigeo:publish

Options:

  • php artisan ubigeo:publish --model
  • php artisan ubigeo:publish --migration
  • php artisan ubigeo:publish --force

Publish and run seeder

php artisan vendor:publish --tag=ubigeo-seeders
php artisan db:seed --class="Database\\Seeders\\UbigeoSeeder"

API endpoints

By default the prefix is ubigeo and middleware is api.

GET /ubigeo/search?code=010000
GET /ubigeo/search?name=lima
GET /ubigeo/departments?name=ama
GET /ubigeo/provinces/010000?name=chacha
GET /ubigeo/districts/010100?name=asuncion

Rules:

  • Department code: ends with 0000 (example 010000).
  • Province code: ends with 00 and excludes departments (example 010100).
  • District responses return id (not code).

Trait methods

use LaravelPeru\Ubigeo\Traits\InteractsWithUbigeo;

class UbigeoService
{
    use InteractsWithUbigeo;
}

Available methods:

  • getDepartament(?string $name = null)
  • getProvice(string $code, ?string $name = null)
  • getDistrict(string $code, ?string $name = null)

Testing

composer test

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固