From 45cb4f06593a1e5a3b558a5cafb69522f0e11c85 Mon Sep 17 00:00:00 2001 From: Irfan Date: Wed, 13 Nov 2024 21:50:14 +0500 Subject: [PATCH 1/2] fixes #519 --- app/Http/Middleware/MicroCaching.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/Http/Middleware/MicroCaching.php b/app/Http/Middleware/MicroCaching.php index 115b1167..43cb29fc 100644 --- a/app/Http/Middleware/MicroCaching.php +++ b/app/Http/Middleware/MicroCaching.php @@ -64,10 +64,14 @@ public function handle($request, Closure $next) // if cache exists, return cache if (Cache::has($fingerprint)) { + $response = \json_decode(Cache::get($fingerprint), true); + + + unset($response['meta']); + unset($response['links']); + return response() - ->json( - \json_decode(Cache::get($fingerprint), true) - ); + ->json($response); } // set cache From b8a24dc144d1e73b87ad22b219ee55a00f103ca7 Mon Sep 17 00:00:00 2001 From: Irfan Date: Wed, 13 Nov 2024 21:50:31 +0500 Subject: [PATCH 2/2] Update MicroCaching.php --- app/Http/Middleware/MicroCaching.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/Http/Middleware/MicroCaching.php b/app/Http/Middleware/MicroCaching.php index 43cb29fc..b3377b95 100644 --- a/app/Http/Middleware/MicroCaching.php +++ b/app/Http/Middleware/MicroCaching.php @@ -66,7 +66,6 @@ public function handle($request, Closure $next) if (Cache::has($fingerprint)) { $response = \json_decode(Cache::get($fingerprint), true); - unset($response['meta']); unset($response['links']);