承接 haegemon/lara-array 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

haegemon/lara-array

Composer 安装命令:

composer require haegemon/lara-array

包简介

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

README 文档

README

Lara-array provide postgresql array datatype support at Eloquent ORM. Inspired by darrylkuhn/dialect.

Installation

Require this package in your composer.json file:

"haegemon/lara-array": "dev-master"

...then run composer update to download the package to your vendor directory.

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:

use Eloquent\LaraArray\LaraArray as LaraArray;

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

And then this:

$marks = $photo->marks;

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

统计信息

  • 总下载量: 222
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2015-09-02