PHPackages                             luiscamp/laravel-peru-ubigeo - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. luiscamp/laravel-peru-ubigeo

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

luiscamp/laravel-peru-ubigeo
============================

Peruvian ubigeo utilities for Laravel applications.

v0.1.2(3mo ago)06MITPHPPHP ^8.2

Since Mar 12Pushed 1w agoCompare

[ Source](https://github.com/jorarmarfin/laravel-peru-ubigeo)[ Packagist](https://packagist.org/packages/luiscamp/laravel-peru-ubigeo)[ Docs](https://github.com/jorarmarfin/laravel-peru-ubigeo)[ RSS](/packages/luiscamp-laravel-peru-ubigeo/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (5)Versions (3)Used By (0)

laravel-peru-ubigeo
===================

[](#laravel-peru-ubigeo)

Base package to work with Peruvian ubigeo data in Laravel.

Installation
------------

[](#installation)

```
composer require luiscamp/laravel-peru-ubigeo
```

Quick start after install
-------------------------

[](#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
--------------

[](#publish-config)

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

Publish migrations
------------------

[](#publish-migrations)

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

Publish model + migration (single command)
------------------------------------------

[](#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
----------------------

[](#publish-and-run-seeder)

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

API endpoints
-------------

[](#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
-------------

[](#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
-------

[](#testing)

```
composer test
```

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance90

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

106d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c3198f0d8e819dddaac96d4b56872c00981ca9821942f1e63db9bfae8135aec6?d=identicon)[luiscamp](/maintainers/luiscamp)

---

Top Contributors

[![jorarmarfin](https://avatars.githubusercontent.com/u/10103033?v=4)](https://github.com/jorarmarfin "jorarmarfin (6 commits)")

---

Tags

laravelperuubigeo

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/luiscamp-laravel-peru-ubigeo/health.svg)

```
[![Health](https://phpackages.com/badges/luiscamp-laravel-peru-ubigeo/health.svg)](https://phpackages.com/packages/luiscamp-laravel-peru-ubigeo)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

59156.3k11](/packages/api-platform-laravel)[wearepixel/laravel-cart

A cart implementation for Laravel

1355.6k](/packages/wearepixel-laravel-cart)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
