From f0f585b58e7f555190009553c75729fe05240953 Mon Sep 17 00:00:00 2001 From: HtmHell Date: Thu, 19 Mar 2020 19:53:12 +0200 Subject: [PATCH 1/2] Fix double json encode --- src/Http/Controller.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Http/Controller.php b/src/Http/Controller.php index 29a8f578..5db322e5 100644 --- a/src/Http/Controller.php +++ b/src/Http/Controller.php @@ -18,8 +18,8 @@ public function html() */ public function json() { - return response()->json( - Storage::disk('local')->get('apidoc/collection.json') + return response()->file( + Storage::disk('local')->path('apidoc/collection.json') ); } } From 981b65499e90650c4ad255722f28ecdbf8862189 Mon Sep 17 00:00:00 2001 From: Ariel Aharonson Date: Sat, 21 Mar 2020 16:06:04 +0200 Subject: [PATCH 2/2] Fix return type Will return JsonResponse as expected --- src/Http/Controller.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Http/Controller.php b/src/Http/Controller.php index 5db322e5..2423c74a 100644 --- a/src/Http/Controller.php +++ b/src/Http/Controller.php @@ -18,8 +18,8 @@ public function html() */ public function json() { - return response()->file( - Storage::disk('local')->path('apidoc/collection.json') + return response()->json( + json_decode(Storage::disk('local')->get('apidoc/collection.json')) ); } }