Download the PHP package iambib/collection-extender without Composer
On this page you can find all versions of the php package iambib/collection-extender. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download iambib/collection-extender
More information about iambib/collection-extender
Files in iambib/collection-extender
Download iambib/collection-extender
More information about iambib/collection-extender
Files in iambib/collection-extender
Vendor iambib
Package collection-extender
Short Description Laravel/Lumen 9+ Collection Extender
License BSD-3-Clause
Package collection-extender
Short Description Laravel/Lumen 9+ Collection Extender
License BSD-3-Clause
Please rate this library. Is it a good library?
Informations about the package collection-extender
Laravel / Lumen Collection extender
This is a set of Illuminate\Support\Collection items I use on a daily bases
Install
REQUIREMENTS
Laravel / Lumen version 9+
Installation
Currently available
Examples
1. $collection->recursive()
From array / multidimensional array
to Illuminate\Support\Collection
2. $collection->pushToKey('foo', 'newValue')
From single key value
To array key value
3. $collection->toModel works in 2 different ways
With model class as param
$collection->toModel(\App\Models\User::class)
From collection
or without model class as param
$collection->toModel()
Which will look for the key that is configured in collection-callback.php as a model_class_key
Config
From collection
To Model
4. $collection->input('bar.foo')
$default can be string or callback
From collection
Returns
$collection->input('bar.foo.empty','Not found')
Returns
5. $collection->morphTo(ApiResponse::class)
Morphs current collection into an object that you need
From collection
to ApiResponse
Support
Hey dude! If you like it .. well
All versions of collection-extender with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.0
ext-json Version *
ext-curl Version *
illuminate/collections Version >=9.0
ext-json Version *
ext-curl Version *
illuminate/collections Version >=9.0
The package iambib/collection-extender contains the following files
Loading the files please wait ....