PHPackages                             erickcg/laravel-postgres - 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. [Database &amp; ORM](/categories/database)
4. /
5. erickcg/laravel-postgres

ActiveLibrary[Database &amp; ORM](/categories/database)

erickcg/laravel-postgres
========================

Eloquent support for postgreSQL fields

v0.1.4(10y ago)02MITPHPPHP &gt;=5.5.9

Since Dec 26Pushed 6y agoCompare

[ Source](https://github.com/erickcg/laravel-postgres)[ Packagist](https://packagist.org/packages/erickcg/laravel-postgres)[ RSS](/packages/erickcg-laravel-postgres/feed)WikiDiscussions master Synced 6d ago

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

laravel-postgres
================

[](#laravel-postgres)

Adds support for postgreSQL fields for Eloquent.

### Installation

[](#installation)

``` composer require asmiarowski/laravel-postgres ``` ### Array field

[](#array-field)

Add trait to your model:

``` use Illuminate\\Database\\Eloquent\\Model; use Smiarowski\\Postgres\\Model\\Traits\\PostgresArray; class ExampleModel extends Model { use PostgresArray; }

```
Set up accessor and mutator for your array field like so:

```

public function setArrayField(array $value) { $this-&gt;array\_field = self::mutateToPgArray($value); } public function getArrayField() { return self::accessPgArray($this-&gt;array\_field); }

```
Query scopes available for builder:
wherePgArrayContains(string $column, mixed $value): Adds where query part, $column has all of the elements in $value. $value can be array, integer or string
wherePgArrayOverlap(string $column, mixed $value): Adds where query part, $column has any (at least one) of the elements in $value. $value can be array, integer or string

For example, let's say you have an array of strings as tags for restaurants. If you would want to find all restaurants that serve pizza or lasagne, you would build your query like so:

```

$restaurants = Restaurant::wherePgArrayOverlap('tag', \['pizza', 'lasagne'\])-&gt;get();

```
Above example would return only thoes restaurants that have tags pizza or lasagne in their defined tags field. If you would want only restaurants that have all of the tags specified, you would use wherePgArrayContains instead.

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 84.2% 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 ~28 days

Total

5

Last Release

3681d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8638247643160d20bf19a10ac3ae8a15a50e17544cbab192ad246e903fce2673?d=identicon)[ecastillo550](/maintainers/ecastillo550)

---

Top Contributors

[![asmiarowski](https://avatars.githubusercontent.com/u/6830139?v=4)](https://github.com/asmiarowski "asmiarowski (16 commits)")[![erickcg](https://avatars.githubusercontent.com/u/2823009?v=4)](https://github.com/erickcg "erickcg (2 commits)")[![xujif](https://avatars.githubusercontent.com/u/1978609?v=4)](https://github.com/xujif "xujif (1 commits)")

---

Tags

laravelpostgresqlpostgres

### Embed Badge

![Health badge](/badges/erickcg-laravel-postgres/health.svg)

```
[![Health](https://phpackages.com/badges/erickcg-laravel-postgres/health.svg)](https://phpackages.com/packages/erickcg-laravel-postgres)
```

###  Alternatives

[tpetry/laravel-postgresql-enhanced

Support for many missing PostgreSQL specific features

9982.0M14](/packages/tpetry-laravel-postgresql-enhanced)[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[umbrellio/laravel-pg-extensions

Extensions for Postgres Laravel

102426.5k1](/packages/umbrellio-laravel-pg-extensions)[umbrellio/laravel-ltree

Extension LTree (Postgres) for Laravel

34111.6k](/packages/umbrellio-laravel-ltree)[asmiarowski/laravel-postgres

Eloquent support for postgreSQL fields

1638.1k1](/packages/asmiarowski-laravel-postgres)[jrsaunders/shard-matrix

A Complete Database Sharding system for MYSQL and/or Postgres. Using Laravels Query Builder easily scale up your application. Configure your whole solution in one Yaml Config file.

271.5k](/packages/jrsaunders-shard-matrix)

PHPackages © 2026

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