定制 konsulting/laravel-extend-collections 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

konsulting/laravel-extend-collections

最新稳定版本:0.2.2

Composer 安装命令:

composer require konsulting/laravel-extend-collections

包简介

A few extensions to the Laravel Collection and Arr.

README 文档

README

A few extensions to the Laravel Collection and Arr.

Installation

composer require konsulting/laravel-extend-collections

Using Laravel

If you are using Laravel 5.5, this package will auto-register the service provider. However, if you have chosen not to auto-register, or are using an earlier version, add the CollectionsServiceProvider to your config/app.php.

'providers' => [
    // Other service providers...

    Konsulting\Laravel\CollectionsServiceProvider::class,
],

Not using Laravel

There is a simple namespaced helper function to assist with extending Collection and Arr.

// Inside your application code, run:

\Konsulting\Laravel\load_collection_extensions();

Arr Extensions

  • fromDot - convert an array where the keys are dot-notation indexed to a nested array

Collection extensions

  • dropEmpty - drop items whose values are empty()
  • deep - apply a function recursively through a collection, and through arrays/collections within it
  • dotGet - retrieve an item using dot-notation
  • dotSet - set an item using dot-notation
  • dotHas - check if an item exists using dot-notation
  • dot - convert a nested collection to dot-notation indexed collection
  • fromDot - convert a dot-notation indexed collection to a nested collection

Contributing

Contributions are welcome and will be fully credited. We will accept contributions by Pull Request.

Please:

  • Use the PSR-2 Coding Standard
  • Add tests, if you’re not sure how, please ask.
  • Document changes in behaviour, including readme.md.

Testing

We use PHPUnit

Run tests using PHPUnit: vendor/bin/phpunit

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-02-06