PHPackages                             lazerg/laravel-macros - 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. lazerg/laravel-macros

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

lazerg/laravel-macros
=====================

Laravel macros

v1.0.1(1y ago)12.7kMITPHPPHP ^8.0|^8.2

Since Feb 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/lazerg/laravel-macros)[ Packagist](https://packagist.org/packages/lazerg/laravel-macros)[ RSS](/packages/lazerg-laravel-macros/feed)WikiDiscussions main Synced 6d ago

READMEChangelogDependencies (3)Versions (16)Used By (0)

A set of useful Laravel macros
==============================

[](#a-set-of-useful-laravel-macros)

[![Version](https://camo.githubusercontent.com/1170a48b6f23a1bdaf0e1bf3631bad31ff4d343b775f8238682ed05eb20d84fc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c617a6572672f6c61726176656c2d6d6163726f732e7376673f7374796c653d706c6173746963)](https://camo.githubusercontent.com/1170a48b6f23a1bdaf0e1bf3631bad31ff4d343b775f8238682ed05eb20d84fc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c617a6572672f6c61726176656c2d6d6163726f732e7376673f7374796c653d706c6173746963)[![Downloads count](https://camo.githubusercontent.com/4a570a211ce81b4ece41098d0f6b14269a9b3b8490d30fcc2416d8b4dff42a92/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6c617a6572672f6c61726176656c2d6d6163726f733f7374796c653d706c6173746963)](https://camo.githubusercontent.com/4a570a211ce81b4ece41098d0f6b14269a9b3b8490d30fcc2416d8b4dff42a92/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6c617a6572672f6c61726176656c2d6d6163726f733f7374796c653d706c6173746963)[![Repository count](https://camo.githubusercontent.com/e3d7ef79bb74a1a2463f9f7e8ea67eb99e334eff55111887aa4ced53c8f1509b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7265706f2d73697a652f6c617a6572672f6c61726176656c2d6d6163726f733f7374796c653d706c6173746963)](https://camo.githubusercontent.com/e3d7ef79bb74a1a2463f9f7e8ea67eb99e334eff55111887aa4ced53c8f1509b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7265706f2d73697a652f6c617a6572672f6c61726176656c2d6d6163726f733f7374796c653d706c6173746963)[![Last commit](https://camo.githubusercontent.com/fe7d1fadcda8bf4aa1193870562289ae9c87a9519ef9d5e3e0d123525a7d9682/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f6c617a6572672f6c61726176656c2d6d6163726f733f7374796c653d706c6173746963)](https://camo.githubusercontent.com/fe7d1fadcda8bf4aa1193870562289ae9c87a9519ef9d5e3e0d123525a7d9682/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f6c617a6572672f6c61726176656c2d6d6163726f733f7374796c653d706c6173746963)[![Stars count](https://camo.githubusercontent.com/bb8fba2477a9dc5707bbcf68c22fe34295e9da8d558c59422dd0efe80873f8f6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f73746172732f6c617a6572672f6c61726176656c2d6d6163726f733f7374796c653d706c6173746963)](https://camo.githubusercontent.com/bb8fba2477a9dc5707bbcf68c22fe34295e9da8d558c59422dd0efe80873f8f6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f73746172732f6c617a6572672f6c61726176656c2d6d6163726f733f7374796c653d706c6173746963)

This repository contains some useful macros.

### Installation

[](#installation)

```
composer require lazerg/laravel-macros
```

The package will automatically register itself.

It is advised to be used with [Laravel IDE Helper](https://github.com/barryvdh/laravel-ide-helper), which generates helper files for your IDE, so it'll be able to highlight and understand some Laravel-specific syntax. This package provides an additional IDE helper file for Laravel macros with the syntax you are already used to in Laravel IDE Helper.

### Additional documentation coming soon...

[](#additional-documentation-coming-soon)

### Macros

[](#macros)

- `Arr::`

    - [`renameKeys`](https://github.com/lazerg/laravel-macros/blob/main/src/Macros/Arr/RenameKeys.php)
- `File::`

    - [`fromJson`](https://github.com/lazerg/laravel-macros/blob/main/src/Macros/File/FromJson.php)
    - [`fromBase64`](https://github.com/lazerg/laravel-macros/blob/main/src/Macros/File/FromBase64.php)
    - [`toBase64`](https://github.com/lazerg/laravel-macros/blob/main/src/Macros/File/ToBase64.php)
    - [`generateName`](https://github.com/lazerg/laravel-macros/blob/main/src/Macros/File/GenerateName.php)
- `Request::`

    - [`isEquals`](https://github.com/lazerg/laravel-macros/blob/main/src/Macros/Request/IsEquals.php)
    - [`whenEquals`](https://github.com/lazerg/laravel-macros/blob/main/src/Macros/Request/WhenEquals.php)
- `Str::`

    - [`bind`](https://github.com/lazerg/laravel-macros/blob/main/src/Macros/Str/Bind.php)
    - [`pluralWithNumber`](https://github.com/lazerg/laravel-macros/blob/main/src/Macros/Str/PluralWithNumber.php)
- `Math::`

    - [`distanceBetween`](https://github.com/lazerg/laravel-macros/blob/main/src/Macros/Math/DistanceBetween.php)
    - [`round5`](https://github.com/lazerg/laravel-macros/blob/main/src/Macros/Math/Round5.php)

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 83.3% 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 ~71 days

Recently: every ~228 days

Total

14

Last Release

615d ago

Major Versions

v0.3.7 → v1.0.02023-06-06

PHP version history (2 changes)v0.1.0PHP ^8.0|^7.3

v1.0.1PHP ^8.0|^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/47a0e1fd676ee37f87a606b2836a322991bf5decac456ec403687e4374519491?d=identicon)[lazerg](/maintainers/lazerg)

---

Top Contributors

[![lazerg](https://avatars.githubusercontent.com/u/20501725?v=4)](https://github.com/lazerg "lazerg (15 commits)")[![itsmirik](https://avatars.githubusercontent.com/u/73518261?v=4)](https://github.com/itsmirik "itsmirik (3 commits)")

---

Tags

laravelphp

### Embed Badge

![Health badge](/badges/lazerg-laravel-macros/health.svg)

```
[![Health](https://phpackages.com/badges/lazerg-laravel-macros/health.svg)](https://phpackages.com/packages/lazerg-laravel-macros)
```

###  Alternatives

[watson/active

Laravel helper for recognising the current route, controller and action

3253.6M14](/packages/watson-active)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[beyondcode/laravel-favicon

Create dynamic favicons based on your environment settings.

37345.5k](/packages/beyondcode-laravel-favicon)[glhd/conveyor-belt

14797.0k](/packages/glhd-conveyor-belt)[dragon-code/pretty-routes

Pretty Routes for Laravel

10058.7k4](/packages/dragon-code-pretty-routes)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40129.3k2](/packages/erlandmuchasaj-laravel-gzip)

PHPackages © 2026

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