for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Imanghafoori\Middlewarize;
use Illuminate\Support\Facades\Cache;
class CacheMiddleware
{
public function handle($data, $next, $key, $ttl)
$ttl = \DateInterval::createFromDateString($ttl);
return Cache::remember($key, $ttl, function () use ($next, $data) {
return $next($data);
});
}