A PSR-6 cache implementation that wraps Laravel's Cache component
PHP
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src Fixed bug with expiresAfter(null) Aug 2, 2016
tests
.gitattributes Made dist not include some files Jun 4, 2016
.gitignore Ignore build folder Jun 4, 2016
.scrutinizer.yml Added scrutinizer config file Jun 4, 2016
.travis.yml Added 7.1 compat Jun 19, 2017
LICENSE Added license Jun 4, 2016
README.md
composer.json
phpunit.xml Added CI configuration Jun 4, 2016

README.md

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

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

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.