PHPackages                             phdevutils/psgc-barangays - 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. phdevutils/psgc-barangays

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

phdevutils/psgc-barangays
=========================

Complete PSGC barangay dataset for the Philippines (PSA Q4 2024, 42,046 entries) with zero-dependency lookup helpers. Joins to phdevutils/core cities/municipalities.

v0.1.0(2mo ago)01MITPHPPHP &gt;=8.2

Since May 25Pushed 2mo agoCompare

[ Source](https://github.com/kon2raya24/ph-psgc-barangays-php)[ Packagist](https://packagist.org/packages/phdevutils/psgc-barangays)[ RSS](/packages/phdevutils-psgc-barangays/feed)WikiDiscussions main Synced 1w ago

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

phdevutils/psgc-barangays
=========================

[](#phdevutilspsgc-barangays)

[![Packagist version](https://camo.githubusercontent.com/f84fb7af08b3d055d9889a62b607537a8c17327cc52db9ad99db9ab60872f190/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70686465767574696c732f707367632d626172616e676179733f6c6162656c3d5061636b616769737426636f6c6f723d663238643161266c6f676f3d7061636b6167697374266c6f676f436f6c6f723d7768697465)](https://packagist.org/packages/phdevutils/psgc-barangays)[![License: MIT](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](../../LICENSE)

The complete **PSGC barangay dataset** for the Philippines — **42,046 barangays** (PSA Q4 2024) — with zero-dependency lookup helpers. Companion to [`phdevutils/core`](https://packagist.org/packages/phdevutils/core); every barangay's `cityMunCode` joins that package's cities/municipalities.

```
composer require phdevutils/psgc-barangays
```

API — `PhDevUtils\PsgcBarangays\Barangays`
------------------------------------------

[](#api--phdevutilspsgcbarangaysbarangays)

Each barangay is an associative array:

```
[
  'code' => '012801001',   // PSGC 9-digit
  'name' => 'Adams (Pob.)',
  'cityMunCode' => '012801',// 6-digit parent (joins phdevutils/core)
  'province' => '0128',     // 4-digit, or null for HUC/NCR
  'region' => '01',         // 2-digit
]
```

### `Barangays::list(array $filter = []): array`

[](#barangayslistarray-filter---array)

Filter keys: `cityMunCode`, `province` (pass `null` to match HUC/NCR), `region`.

```
Barangays::list(['cityMunCode' => '012801']);
Barangays::list(['region' => '13']);     // all NCR
Barangays::list(['province' => null]);   // HUC/NCR with no province
```

### `Barangays::find(string $code): ?array`

[](#barangaysfindstring-code-array)

Exact match by 9-digit PSGC code (names are not unique).

```
Barangays::find('012801001'); // ['code' => '012801001', 'name' => 'Adams (Pob.)', ...]
Barangays::find('999999999'); // null
```

### `Barangays::findByName(string $name, array $filter = []): array`

[](#barangaysfindbynamestring-name-array-filter---array)

Case-insensitive. **Always returns a list** — names repeat heavily ("Poblacion" 605×, "San Isidro" 296×).

```
Barangays::findByName('San Isidro');                    // 296
Barangays::findByName('San Isidro', ['region' => '13']); // 3
```

### `Barangays::count(array $filter = []): int`

[](#barangayscountarray-filter---int)

```
Barangays::count();                   // 42046
Barangays::count(['region' => '13']); // 1710
```

License
-------

[](#license)

MIT

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance88

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

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

Unknown

Total

1

Last Release

61d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

barangayscomposerphilippinesphppsgcaddressphilippinesbarangaypsapsgcbarangaysfilipino

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/phdevutils-psgc-barangays/health.svg)

```
[![Health](https://phpackages.com/badges/phdevutils-psgc-barangays/health.svg)](https://phpackages.com/packages/phdevutils-psgc-barangays)
```

###  Alternatives

[mlocati/ip-lib

Handle IPv4, IPv6 addresses and ranges

3167.3M73](/packages/mlocati-ip-lib)[markrogoyski/ipv4-subnet-calculator

Network calculator for subnet mask and other classless (CIDR) network information.

175852.6k14](/packages/markrogoyski-ipv4-subnet-calculator)[sylius/addressing-bundle

Addressing and zone management for Symfony applications.

34235.1k5](/packages/sylius-addressing-bundle)[tapp/filament-google-autocomplete-field

Filament plugin that provides a Google Autocomplete field

30136.4k](/packages/tapp-filament-google-autocomplete-field)[yieldstudio/nova-google-autocomplete

A Laravel Nova Google autocomplete field.

12239.3k](/packages/yieldstudio-nova-google-autocomplete)[olifanton/interop

Olifanton interop library

1076.0k3](/packages/olifanton-interop)

PHPackages © 2026

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