src/Http/Middleware/CacheResponse.php
public function handle($request, Closure $next, $tag = null)
    {
        if(!env('CACHE_RESPONSE', false)) {
            return $next($request);
        }

        $key = md5($request->fullUrl());

        $tags = ['response', $tag];

        if (Cache::tags($tags)->has($key)) {
            return Cache::tags($tags)->get($key);
        }

        $response = $next($request);

        Cache::tags($tags)->put($key, $response, 60 * 24);

        return $response;
    }
public function handle($request, Closure $next, $tag = null)
    {
        if(!env('CACHE_RESPONSE', false)) {
            return $next($request);
        }

        $key = md5($request->fullUrl());

        $tags = ['response', $tag];

        if (Cache::tags($tags)->has($key)) {
            return Cache::tags($tags)->get($key);
        }

        $response = $next($request);

        Cache::tags($tags)->put($key, $response, 60 * 24);

        return $response;
    }
Handle an incoming request.

@param  \Illuminate\Http\Request  $request
@param  \Closure  $next
@return mixed