PHPackages                             baironbernal/colombia-locations - 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. baironbernal/colombia-locations

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

baironbernal/colombia-locations
===============================

Paquete con todos los departamentos y municipios de Colombia para Laravel

1.0.0(1mo ago)07MITPHPPHP ^8.1

Since Apr 11Pushed 1mo agoCompare

[ Source](https://github.com/baironbernal/colombia-locations)[ Packagist](https://packagist.org/packages/baironbernal/colombia-locations)[ RSS](/packages/baironbernal-colombia-locations/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Colombia Locations for Laravel
==============================

[](#colombia-locations-for-laravel)

A Laravel package that provides all **33 departments** and **1,122+ municipalities** of Colombia, based on official DANE (Departamento Administrativo Nacional de Estadística) codes.

Requirements
------------

[](#requirements)

- PHP 8.1+
- Laravel 10, 11, or 12

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

[](#installation)

Install the package via Composer:

```
composer require baironbernal/colombia-locations
```

Laravel will automatically discover the service provider. Then run the migrations:

```
php artisan migrate
```

Finally, seed the database with all Colombian departments and municipalities:

```
php artisan db:seed --class="BaironBernal\ColombiaLocations\Database\Seeders\ColombiaLocationsSeeder"
```

Database Structure
------------------

[](#database-structure)

### `departments` table

[](#departments-table)

ColumnTypeDescription`id`bigint (PK)Auto-incremental primary key`code`varchar(2)Official DANE code (e.g. `"05"`)`name`varchar(100)Department name (e.g. `"Antioquia"`)### `municipalities` table

[](#municipalities-table)

ColumnTypeDescription`id`bigint (PK)Auto-incremental primary key`code`varchar(5)Official DANE code (e.g. `"05001"`)`name`varchar(150)Municipality name (e.g. `"Medellín"`)`department_id`bigint (FK)Foreign key to `departments.id`> **About DANE codes:** The municipality code is formed by the 2-digit department code + 3 digits for the municipality. For example, `05001` = Medellín (`05` = Antioquia, `001` = Medellín).

Usage
-----

[](#usage)

The package ships with two Eloquent models you can use directly.

### Get all departments

[](#get-all-departments)

```
use BaironBernal\ColombiaLocations\Models\Department;

$departments = Department::all();
```

### Get all municipalities of a department

[](#get-all-municipalities-of-a-department)

```
use BaironBernal\ColombiaLocations\Models\Department;

$antioquia = Department::where('code', '05')->first();
$municipalities = $antioquia->municipalities;
```

### Get a municipality with its department

[](#get-a-municipality-with-its-department)

```
use BaironBernal\ColombiaLocations\Models\Municipality;

$medellin = Municipality::where('code', '05001')->first();
echo $medellin->name;              // "Medellín"
echo $medellin->department->name;  // "Antioquia"
```

### Search municipalities by name

[](#search-municipalities-by-name)

```
use BaironBernal\ColombiaLocations\Models\Municipality;

$results = Municipality::where('name', 'like', '%bogotá%')->get();
```

### Get departments with their municipalities eager loaded

[](#get-departments-with-their-municipalities-eager-loaded)

```
use BaironBernal\ColombiaLocations\Models\Department;

$departments = Department::with('municipalities')->get();
```

Publishing Assets
-----------------

[](#publishing-assets)

If you want to customize the migrations or seeders, you can publish them to your project:

```
# Publish migrations
php artisan vendor:publish --tag=colombia-locations-migrations

# Publish seeders
php artisan vendor:publish --tag=colombia-locations-seeders
```

Data Coverage
-------------

[](#data-coverage)

DepartmentMunicipalitiesAntioquia125Atlántico23Bogotá D.C.1Bolívar46Boyacá123Caldas27Caquetá16Cauca42Cesar25Chocó31Córdoba30Cundinamarca116Huila37La Guajira15Magdalena30Meta29Nariño64Norte de Santander40Quindío12Risaralda14Santander87Sucre26Tolima47Valle del Cauca42Arauca7Casanare19Putumayo13San Andrés y Providencia2Amazonas11Guainía9Guaviare4Vaupés6Vichada4License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance88

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

59d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4d4603a262ff52edcf200306c1f590fb21aaf600b53b7d4c111cd015043aada7?d=identicon)[baironbernal](/maintainers/baironbernal)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/baironbernal-colombia-locations/health.svg)

```
[![Health](https://phpackages.com/badges/baironbernal-colombia-locations/health.svg)](https://phpackages.com/packages/baironbernal-colombia-locations)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[wearepixel/laravel-cart

A cart implementation for Laravel

1355.6k](/packages/wearepixel-laravel-cart)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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