PHPackages                             rickselby/laravel-gate-cache - 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. [Caching](/categories/caching)
4. /
5. rickselby/laravel-gate-cache

AbandonedArchivedLibrary[Caching](/categories/caching)

rickselby/laravel-gate-cache
============================

Add a per-request caching layer to Laravel's Gate

3.9.0(1y ago)23123.7k↓54.7%5[2 PRs](https://github.com/rickselby/laravel-gate-cache/pulls)MITPHPCI passing

Since Oct 10Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/rickselby/laravel-gate-cache)[ Packagist](https://packagist.org/packages/rickselby/laravel-gate-cache)[ RSS](/packages/rickselby-laravel-gate-cache/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (10)Dependencies (4)Versions (17)Used By (0)

Laravel Gate Cache
==================

[](#laravel-gate-cache)

[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE)[![Packagist Version](https://camo.githubusercontent.com/eb0b2f1bb6e039204c10fe4fd9d3915fca7f1a139c2ac0f9895a885e55f7b56e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7269636b73656c62792f6c61726176656c2d676174652d6361636865)](https://camo.githubusercontent.com/eb0b2f1bb6e039204c10fe4fd9d3915fca7f1a139c2ac0f9895a885e55f7b56e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7269636b73656c62792f6c61726176656c2d676174652d6361636865)

Add a per-request caching layer to Laravel's Gate.

Laravel Auto Presenter MapperLaravel**3.x**5.5-11.x2.x5.5-5.81.x5.5-5.7Installing
----------

[](#installing)

Require the project using [Composer](https://getcomposer.org):

```
$ composer require rickselby/laravel-gate-cache
```

Laravel will auto-discover the package.

Use Case
--------

[](#use-case)

As discussed on [reddit](https://www.reddit.com/r/laravel/comments/9mknx6/) - multiple calls to `Gate` methods result in the underlying code being re-run. Take this pseudo-blade-code, for example:

```
@foreach($posts as $post)
    @can('add_posts') BUTTON @endcan
    @can('edit_posts') BUTTON @endcan
    @can('delete_posts') BUTTON @endcan
@endforeach

```

Normally, each permission check would be called as many times as there are posts. With this package, they will only be called once; their results will be cached for any further calls.

Note that this is per-request only. Each request will test each permission once... but only once.

License
-------

[](#license)

Laravel Form Components is licensed under [The MIT License (MIT)](LICENSE).

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance50

Moderate activity, may be stable

Popularity43

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 86.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 ~179 days

Recently: every ~218 days

Total

14

Last Release

532d ago

Major Versions

v1.1 → v2.02019-05-23

v2.0 → 3.02019-10-12

### Community

Maintainers

![](https://www.gravatar.com/avatar/6cc8910980f053d8ceb2e9d938427cf03ae509884763a10f916b4eef5591934f?d=identicon)[rickselby](/maintainers/rickselby)

---

Top Contributors

[![rickselby](https://avatars.githubusercontent.com/u/1564517?v=4)](https://github.com/rickselby "rickselby (82 commits)")[![elbojoloco](https://avatars.githubusercontent.com/u/7912315?v=4)](https://github.com/elbojoloco "elbojoloco (5 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (2 commits)")[![sijones-uk](https://avatars.githubusercontent.com/u/13103339?v=4)](https://github.com/sijones-uk "sijones-uk (1 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rickselby-laravel-gate-cache/health.svg)

```
[![Health](https://phpackages.com/badges/rickselby-laravel-gate-cache/health.svg)](https://phpackages.com/packages/rickselby-laravel-gate-cache)
```

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

13.0k107.5M1.6k](/packages/spatie-laravel-permission)[nuwave/lighthouse

A framework for serving GraphQL from Laravel

3.5k12.2M128](/packages/nuwave-lighthouse)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k16.3M154](/packages/laravel-pulse)[illuminate/cache

The Illuminate Cache package.

12937.6M2.0k](/packages/illuminate-cache)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9922.4M146](/packages/roots-acorn)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)

PHPackages © 2026

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