PHPackages                             emrul1875/laravel-extra-collection - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. emrul1875/laravel-extra-collection

ActiveLibrary

emrul1875/laravel-extra-collection
==================================

An extra collection pacakge for Laravel

v0.0.2(4y ago)33MITPHPPHP ^7.4|^8.0

Since Oct 29Pushed 4y ago1 watchersCompare

[ Source](https://github.com/emrul1875/laravel-extra-collection)[ Packagist](https://packagist.org/packages/emrul1875/laravel-extra-collection)[ Docs](https://github.com/emrul1875/laravel_extra_collection)[ RSS](/packages/emrul1875-laravel-extra-collection/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Laravel Extra Collection
========================

[](#laravel-extra-collection)

This is a package of Laravel Collection which can be used with laravel existing collection. You are welcome to give new idea or contribute in repository. Let's make our lives much more easier.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require emrul1875/laravel-extra-collection
```

Usage
-----

[](#usage)

The package is auto-discovered!

Add the service provider to `config/app.php`

```
Emrul1875\LaravelExtraCollection\LaravelExtraCollectionServiceProvider::class
```

### Collections

[](#collections)

`prependValue`

The `prependValue()` method receive 3 parameter. First 2 parameter is mandatory and 3rd parameter is optional.First parameter receive an array or string. If your collection is sequential array you can pass string as a first parameter otherwise pass an array. The array should contain key and value pair where key will be the property name of collection which should be changed and value should be the text that needs to prepend with value. You can pass true or false in thrid parameter. By default it is false. If you pass true it will skip all property which has null value.

```
