New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

madewithlove/illuminate-psr-cache-bridge

1,475,956 84
Install
composer require madewithlove/illuminate-psr-cache-bridge
Latest Version:1.0.3
PHP:>=5.6.0
Laravel:5
License:MIT
Last Updated:Nov 30, 2019
Links: GitHub  ·  Packagist
Maintainer: hannesvdvreken

PSR-6 cache implementation that connects to Laravel's cache Repository

Latest Version on Packagist Software License Build Status Code Coverage Quality Score

This package adds PSR-6 cache support to Laravel 5. Laravel 6 has PSR-6 support build in which can be used through the cache.psr6 container alias.

Usage

To start using a Psr\Cache\CacheItemPoolInterface typed implementation that stores data in Laravel's configured cache, add this to a service provider:

use Illuminate\Contracts\Cache\Repository;
use Madewithlove\IlluminatePsrCacheBridge\Laravel\CacheItemPool;
use Psr\Cache\CacheItemPoolInterface;

$this->app->singleton(CacheItemPoolInterface::class, function ($app) {
    $repository = $app->make(Repository::class);

    return new CacheItemPool($repository);
});

Right now you're all set to start injecting CacheItemPoolInterface'd everywhere you need it.

Install

In order to install it via composer you should run this command:

composer require madewithlove/illuminate-psr-cache-bridge

Testing

vendor/bin/phpunit

# or:
vendor/bin/phpunit --testsuite=integration-tests
vendor/bin/phpunit --testsuite=unit-tests

Credits

All Contributors

License

The MIT License (MIT). Please see License File for more information.

Related Packages

darrynten/any-cache

Adapter designed to add Framework Agnosticism for Caching within PHP Packages.

81,255 8
cache/illuminate-adapter

A PSR-6 cache implementation using Illuminate. This implementation supports tags

80,035 11
einar-hansen/laravel-psr-6-cache

A PHP service that allows you to easily communicate with football-data.org apis...

35,040 1
bunkuris/has-cache

HasCache trait for Laravel models with cache key managers

3,582 0

Version History

Version Released PHP Laravel License
1.0.3 >=5.6.0 ^5.0 MIT
1.0.2 >=5.6.0 ^5.0 MIT
1.0.1 >=5.6.0 ^5.0 MIT
1.0.0 >=5.5.0 ^5.0 MIT