2017 © Pedro Peláez
 

library lara-array

Lara-array provide postgresql array datatype support at Eloquent ORM.

image

haegemon/lara-array

Lara-array provide postgresql array datatype support at Eloquent ORM.

  • Monday, February 12, 2018
  • by haegemon
  • Repository
  • 1 Watchers
  • 1 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Lara-array

Lara-array provide postgresql array datatype support at Eloquent ORM. Inspired by darrylkuhn/dialect., (*1)

Installation

Require this package in your composer.json file:, (*2)

"haegemon/lara-array": "dev-master", (*3)

...then run composer update to download the package to your vendor directory., (*4)

Usage

The feature is exposed through a trait rewrite standart casting attributes to change array parse from json_decode to special parser for postgresql array. For example we could create a Photos model like this:, (*5)


use Eloquent\LaraArray\LaraArray as LaraArray; class Photo extends Eloquent { use LaraArray; protected $casts = [ 'marks' => 'array', ]; }

And then this:, (*6)


$marks = $photo->marks; var_dump($marks); // array(2) { [0]=> string(1) "5" [1]=> string(1) "2" }

The Versions

12/02 2018

dev-master

9999999-dev

Lara-array provide postgresql array datatype support at Eloquent ORM.

  Sources   Download

Apache-2.0 Apache

The Requires

 

by Avatar haegemon