PHPackages                             mattkingshott/elevate - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. mattkingshott/elevate

Abandoned → [caneara/elevate](/?search=caneara%2Felevate)ArchivedLibrary[Utility &amp; Helpers](/categories/utility)

mattkingshott/elevate
=====================

A package that provides a library of macro functions for various Laravel components.

v1.5.0(5y ago)2951MITPHPPHP ^7.4|^8.0

Since Apr 26Pushed 3y agoCompare

[ Source](https://github.com/caneara/elevate)[ Packagist](https://packagist.org/packages/mattkingshott/elevate)[ Docs](https://github.com/mattkingshott/elevate)[ RSS](/packages/mattkingshott-elevate/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (10)Dependencies (5)Versions (11)Used By (0)

Elevate
=======

[](#elevate)

This package provides a library of macro functions for various Laravel components. Use them to augment the existing functionality offered by the likes of Blade, Collections, Stringable, and so on.

Initially, only a handful of macros are available. That said, the library has been designed so that it can handle dozens or even hundreds of macros being added over time. Each individual macro may also be disabled, thus ensuring that Laravel isn't spending precious time registering macros you are not using.

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

[](#installation)

Pull in the package using composer

```
composer require caneara/elevate
```

Configuration
-------------

[](#configuration)

If you wish to make all of the macros available to your application, then you can skip this section. Otherwise, you should publish the configuration file using Artisan:

```
php artisan vendor:publish --provider="Elevate\ServiceProvider"
```

You may wish to disable a particular macro for one of the following reasons:

1. **Performance** - if you aren't using the macro, or even the class itself, then disabling it will net a tiny performance boost.
2. **Conflicts** - if you already have a macro for a class, or wish to create one with the same name, you should disable the Elevate macro to prevent conflicts.

To prevent a macro being registered, simply set its value to `false`:

```
'Blade' => [
    'Blank'  => true,
    'Filled' => false,
];
```

Available macros
----------------

[](#available-macros)

The following macros are currently available:

MacroClassDescriptionfilledBladeEnables the use of @filled() and @endfilled. Uses the filled() global helper under the hood. You may also use @else e.g. @filled() @else @endfilledblankBladeEnables the use of @blank() and @endblank. Uses the blank() global helper under the hood. You may also use @else e.g. @blank() @else @endblankappendIfStringableAppends the given string to the string if it doesn't already finish with itcollapseStringableTrims the string and replaces multiple whitespace characters with a single spacecountStringableDetermine the total number of times the given string appears within the stringgetStringableAdds a more friendly helper to access a fluent string's content e.g. Str::of('test')-&gt;get()insertStringableInjects the given string at the given indexpadLeftStringablePad the string to the given length from the left sidepadRightStringablePad the string to the given length from the right sidepossessiveStringableConverts the string to a possessive version e.g. Bob -&gt; Bob'sprependIfStringablePrepends the given string to the string if it doesn't already start with itsegmentStringableSplits the string using the given delimiter, then retrieves the item at the given array indextoArrayStringableConverts the string into an array of characterstoggleStringableToggles the string between two states. Contains a $loose flag to allow the switching of a string that matches neither statesafterCollectionGet the next item from the collectionatCollectionRetrieve an item at an indexsecondCollectionRetrieve item at the second indexthirdCollectionRetrieve item at the third indexfourthCollectionRetrieve item at the fourth indexfifthCollectionRetrieve item at the fifth indexsixthCollectionRetrieve item at the sixth indexseventhCollectionRetrieve item at the seventh indexeighthCollectionRetrieve item at the eighth indexninthCollectionRetrieve item at the ninth indextenthCollectionRetrieve item at the tenth indexbeforeCollectionGet the previous item from the collectioncarbonizeCollectionConvert all collection items into instances of CarbonImmutablechunkByCollectionChunks the values from a collection into groups as long the given callback is truecollectByCollectionGet an item at a given key, and collect iteachConsCollectionGet the following consecutive neighbours in a collection from a given chunk sizeextractCollectionExtract keys from a collectionfilterMapCollectionMap a collection and remove falsy values in one gofirstOrFailCollectionGet the first item or throw an exceptionfromPairsCollectionTransform a collection into an associative array form collection itemglobCollectionReturns a collection of a `glob()` resultgroupByModelCollectionSimilar to `groupBy`, but groups the collection by an Eloquent modelheadCollectionRetrieves first item from the collectionifAnyCollectionExecutes the passed callable if the collection isn't emptyifEmptyCollectionExecutes the passed callable if the collection is emptynoneCollectionChecks whether a collection doesn't contain any occurrences of a given item, key-value pair, or passing truth testpaginateCollectionCreate a `LengthAwarePaginator` instance for the items in the collectionparallelMapCollectionIdentical to `map` but each item in the collection will be processed in parallelpluckToArrayCollectionReturns array of values of a given keyprioritizeCollectionMove elements to the start of the collectionrotateCollectionRotate the items in the collection with given offsetsectionByCollectionSplits a collection into sections grouped by a given keysimplePaginateCollectionCreate a `Paginator` instance for the items in the collectionsliceBeforeCollectionSlice the values out from a collection before the given callback is truetailCollectionExtract the tail from a collection (everything except the first element)toPairsCollectionTransform a collection into an array with pairstransformKeysCollectionPerforms a transform operation, but on the collection's keys instead of its valuestransposeCollectionRotate a multidimensional array, turning the rows into columns and the columns into rowstrimCollectionMaps over each item in the collection and calls PHP's trim() method on itvalidateCollectionReturns true if the given callback returns true for every itemwithSizeCollectionCreate a new collection with the specified amount of itemsContributing
------------

[](#contributing)

Thank you for considering a contribution to Elevate. You are welcome to submit a PR containing a new macro or improvements to existing ones, however please also be sure to include a test or tests where appropriate.

Credits
-------

[](#credits)

The library includes macros and / or code obtained from the following open-source packages:

- [Laravel Collection Macros](https://github.com/spatie/laravel-collection-macros) by [Spatie](https://spatie.be)
- [Laravel Helpers](https://github.com/sebastiaanluca/laravel-helpers) by [sebastiaanluca](https://github.com/sebastiaanluca)
- [String Library](https://github.com/spatie/string) by [Spatie](https://spatie.be)
- [Underscore Library](https://github.com/Anahkiasen/underscore-php) by [Emma Fabre](https://autopergamene.eu)
- [Nette Utilities](https://github.com/nette/utils) by [Nette Foundation](https://nette.org)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~25 days

Recently: every ~55 days

Total

10

Last Release

1989d ago

PHP version history (2 changes)v1.0PHP ^7.4

1.4.1PHP ^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/22bc3f376c7511f4fc85e2c240cf52c075c491426795c71409c0a4b551a8bf85?d=identicon)[mattkingshott](/maintainers/mattkingshott)

---

Top Contributors

[![mattkingshott](https://avatars.githubusercontent.com/u/51963402?v=4)](https://github.com/mattkingshott "mattkingshott (43 commits)")

---

Tags

phplaravelmacroelevate

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mattkingshott-elevate/health.svg)

```
[![Health](https://phpackages.com/badges/mattkingshott-elevate/health.svg)](https://phpackages.com/packages/mattkingshott-elevate)
```

###  Alternatives

[amranidev/laracombee

Recommendation system for laravel

11636.7k1](/packages/amranidev-laracombee)[wujunze/money-wrapper

MoneyPHP Wrapper

113.8k](/packages/wujunze-money-wrapper)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
