PHPackages                             themonkeys/blade-cache-filter - 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. themonkeys/blade-cache-filter

ActiveLibrary

themonkeys/blade-cache-filter
=============================

A simple caching filter that caches Laravel's Response objects

5965PHP

Since Dec 16Pushed 12y ago6 watchersCompare

[ Source](https://github.com/TheMonkeys/laravel-blade-cache-filter)[ Packagist](https://packagist.org/packages/themonkeys/blade-cache-filter)[ RSS](/packages/themonkeys-blade-cache-filter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

[![The Monkeys](https://camo.githubusercontent.com/580df7170b07322a64b603ab110484f004b2464ccf1a56e9fc2b3dad16b39378/687474703a2f2f7777772e7468656d6f6e6b6579732e636f6d2e61752f696d672f6d6f6e6b65795f6c6f676f2e706e67)](https://camo.githubusercontent.com/580df7170b07322a64b603ab110484f004b2464ccf1a56e9fc2b3dad16b39378/687474703a2f2f7777772e7468656d6f6e6b6579732e636f6d2e61752f696d672f6d6f6e6b65795f6c6f676f2e706e67)

Laravel Blade Cache Filter
==========================

[](#laravel-blade-cache-filter)

A simple caching filter that caches Laravel's Response objects.

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

[](#installation)

To get the latest version of the filter simply require it in your composer.json file by running:

```
composer require themonkeys/blade-cache-filter:dev-master --no-update
composer update themonkeys/blade-cache-filter
```

Once the filter is installed you need to register the service provider with the application. Open up `app/config/app.php` and find the `providers` key.

```
'providers' => array(
    'Themonkeys\BladeCacheFilter\BladeCacheFilterServiceProvider',
)
```

Now add the filter to the bottom of your `app/filters.php` file:

```
if (Config::get('blade-cache-filter::bladeCacheExpiry') > 0) {
    Route::filter('cache', 'BladeCacheFilter');
}
```

The filter caches your responses using the standard Laravel cache subsystem, so you might want to configure that too by following the [Laravel documentation](http://laravel.com/docs/cache). Laravel comes configured with sensible defaults that work, so you can leave that part until later if you prefer.

Usage
-----

[](#usage)

After following the instructions above, the filter is installed but not attached to any routes. To add caching to a route, you need to add the `'cache'` filter both `'before'` and `'after'` the route in your `app/routes.php` file:

```
Route::get('/url', array('before' => 'cache', 'after' => 'cache', 'uses' => 'Controller@method'));
```

To add caching to a collection of routes, use a route group:

```
Route::group(array('before' => 'cache', 'after' => 'cache'), function() {
    Route::get('/url1', 'Controller@method1');
    Route::get('/url2', 'Controller@method2');
});
```

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

[](#configuration)

To configure the package, you can use the following command to copy the configuration file to `app/config/packages/themonkeys/blade-cache-filter`.

```
php artisan config:publish themonkeys/blade-cache-filter
```

Or you can just create a new file in that folder and only override the settings you need.

The settings themselves are documented inside `config.php`. The default configuration is for the filter to do nothing, so you'll need to at least set the `'bladeCacheExpiry'` property to a positive number of minutes in the environments where you want caching to be enabled.

Contribute
----------

[](#contribute)

In lieu of a formal styleguide, take care to maintain the existing coding style.

License
-------

[](#license)

MIT License (c) [The Monkeys](http://www.themonkeys.com.au/)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/0dfaf828dc2ea54f09527e617def81bdeca8c54d7e912cbb94033a46771cf0cd?d=identicon)[themonkeys](/maintainers/themonkeys)

---

Top Contributors

[![felthy](https://avatars.githubusercontent.com/u/1940215?v=4)](https://github.com/felthy "felthy (2 commits)")

### Embed Badge

![Health badge](/badges/themonkeys-blade-cache-filter/health.svg)

```
[![Health](https://phpackages.com/badges/themonkeys-blade-cache-filter/health.svg)](https://phpackages.com/packages/themonkeys-blade-cache-filter)
```

PHPackages © 2026

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