seatplus/esi-client

View on GitHub
src/CacheMiddleware/LaravelFileCacheMiddleware.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
<?php

namespace Seatplus\EsiClient\CacheMiddleware;

use Illuminate\Support\Facades\Cache;
use Kevinrob\GuzzleCache\CacheMiddleware;
use Kevinrob\GuzzleCache\Storage\LaravelCacheStorage;
use Kevinrob\GuzzleCache\Strategy\PrivateCacheStrategy;

class LaravelFileCacheMiddleware implements CacheMiddlewareInterface
{
    #[\Override]
    public function getCacheMiddleware(): CacheMiddleware
    {
        return new CacheMiddleware(
            new PrivateCacheStrategy(
                new LaravelCacheStorage(
                    Cache::store('file')
                )
            )
        );
    }
}