PHPackages                             laragrad/pg-helper - 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. laragrad/pg-helper

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

laragrad/pg-helper
==================

v1.0.1(2y ago)0322MITPHPPHP ^7.2|^8.0

Since Jun 6Pushed 2y ago1 watchersCompare

[ Source](https://github.com/laragrad/pg-helper)[ Packagist](https://packagist.org/packages/laragrad/pg-helper)[ RSS](/packages/laragrad-pg-helper/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (2)DependenciesVersions (3)Used By (2)

laragrad/pg-helper
==================

[](#laragradpg-helper)

This package provides a class `\Laragrad\Support\PgHelper` with functions for PostgreSQL array convertions.

Installing
----------

[](#installing)

Run command in console

```
composer require laragrad/pg-helper

```

Functions
---------

[](#functions)

All functions are static.

### toPgArray()

[](#topgarray)

Converts 1-dimension PHP-array to Pg-array string

Syntax:

`toPgArray(mixed $arr = null) : string`

Arguments:

- **$value** - Converted value. It is required and can by array, integer, string or null.

Returns a PostgreSQL array string.

### fromPgArray()

[](#frompgarray)

Converts PostgreSQL 1-dimension array string to PHP-array. Casts all array items into one of types 'string','int' or 'float' if it need.

Syntax:

`fromPgArray(string|null $value, string|null $castType = null) : array|null`

Arguments:

- **$value** - Converted value. It is required and must be one dimentional PostgreSQL array string or NULL.
- **$castType** - Array items cast type. Cast type value must be one of next strings: 'string', 'text', 'uuid', 'int', 'integer', 'float'.

Returns a PHP-array.

### isPgArray()

[](#ispgarray)

Find whether the variable is PostgreSQL string

Syntax:

`fromPgArray(mixed $value) : array`

Arguments:

- **$value** - Testing value

Returns TRUE if value is PostgreSQL one dimensional array string.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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 ~1278 days

Total

2

Last Release

892d ago

PHP version history (2 changes)v1.0PHP ^7.2.0

v1.0.1PHP ^7.2|^8.0

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

laravelhelperpostgres

### Embed Badge

![Health badge](/badges/laragrad-pg-helper/health.svg)

```
[![Health](https://phpackages.com/badges/laragrad-pg-helper/health.svg)](https://phpackages.com/packages/laragrad-pg-helper)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[cartalyst/support

Support helpers.

762.8M14](/packages/cartalyst-support)

PHPackages © 2026

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