PHPackages                             nham24/macroable - 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. nham24/macroable

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

nham24/macroable
================

A set of useful Laravel macros

0.1.1(2y ago)024MITPHPPHP &gt;=7.2

Since Jul 14Pushed 2y ago3 watchersCompare

[ Source](https://github.com/go24dev/macroable)[ Packagist](https://packagist.org/packages/nham24/macroable)[ Docs](https://github.com/go24dev/marcoable)[ RSS](/packages/nham24-macroable/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (6)Versions (10)Used By (0)

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

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

This repository contains some useful macros and extensible Macroable trait.

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

[](#installation)

You can pull in the package via composer:

```
composer require nham24/macroable
```

The package will automatically register itself.

Collections
-----------

[](#collections)

- [`paginate`](#paginate)

### `paginate`

[](#paginate)

Create a `LengthAwarePaginator` instance for the items in the collection.

```
collect($posts)->paginate(5);
```

This paginates the contents of `$posts` with 5 items per page. `paginate` accepts quite some options, head over to [the Laravel docs](https://laravel.com/docs/5.4/pagination) for an in-depth guide.

```
paginate(int $perPage = 15, string $pageName = 'page', int $page = null, int $total = null, array $options = [])

```

### Request

[](#request)

- [`isApi`](#isJson)

### `isApi`

[](#isapi)

Check if the request is an API request.

```
$request =

request()->isApi();
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 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 ~0 days

Total

8

Last Release

1037d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/db6694a3e838d346081d216f29dd7aeb037e67ea2123391f263e060a903ded2e?d=identicon)[semsphy](/maintainers/semsphy)

---

Top Contributors

[![semsphy](https://avatars.githubusercontent.com/u/423396?v=4)](https://github.com/semsphy "semsphy (16 commits)")

---

Tags

macroablenham24

###  Code Quality

TestsPest

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/nham24-macroable/health.svg)

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[spatie/macroable

A trait to dynamically add methods to a class

72659.6M64](/packages/spatie-macroable)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

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