2017 © Pedro Peláez
 

library laravel-extend-collections

A few extensions to the Laravel Collection and Arr.

image

konsulting/laravel-extend-collections

A few extensions to the Laravel Collection and Arr.

  • Friday, February 9, 2018
  • by konsulting
  • Repository
  • 1 Watchers
  • 1 Stars
  • 168 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 10 % Grown

The README.md

Laravel Extend Collections

A few extensions to the Laravel Collection and Arr., (*1)

Installation

composer require konsulting/laravel-extend-collections, (*2)

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., (*3)

'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., (*4)

// 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., (*5)

Please:, (*6)

  • 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, (*7)

Run tests using PHPUnit: vendor/bin/phpunit, (*8)

The Versions

09/02 2018

dev-master

9999999-dev

A few extensions to the Laravel Collection and Arr.

  Sources   Download

MIT

The Requires

 

The Development Requires

09/02 2018

0.1.2

0.1.2.0

A few extensions to the Laravel Collection and Arr.

  Sources   Download

MIT

The Requires

 

The Development Requires

01/09 2017

0.1.1

0.1.1.0

A few extensions to the Laravel Collection and Arr.

  Sources   Download

MIT

The Requires

 

The Development Requires

09/05 2017

dev-analysis-8Q1wG6

dev-analysis-8Q1wG6

A few extensions to the Laravel Collection and Arr.

  Sources   Download

MIT

The Requires

 

The Development Requires

06/02 2017

0.1.0

0.1.0.0

A few extensions to the Laravel Collection and Arr.

  Sources   Download

MIT

The Requires

 

The Development Requires