From ba64bad7242cee93afa39e46c38868871186466f Mon Sep 17 00:00:00 2001 From: twestrick Date: Sat, 26 Oct 2024 13:15:09 -0400 Subject: [PATCH] Move abort inline with previous code --- src/Http/Controllers/ScriptController.php | 4 +--- src/Http/Controllers/StyleController.php | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Http/Controllers/ScriptController.php b/src/Http/Controllers/ScriptController.php index bf9dcc9..57d495d 100644 --- a/src/Http/Controllers/ScriptController.php +++ b/src/Http/Controllers/ScriptController.php @@ -13,10 +13,8 @@ class ScriptController extends Controller */ public function __invoke(Request $request) { - $scriptPath = LaRecipe::allScripts()[$request->script] ?? abort(404); - return response( - file_get_contents($scriptPath), + file_get_contents(LaRecipe::allScripts()[$request->script] ?? abort(404)), 200, ['Content-Type' => 'application/javascript'] ); diff --git a/src/Http/Controllers/StyleController.php b/src/Http/Controllers/StyleController.php index f952956..3b6ace8 100644 --- a/src/Http/Controllers/StyleController.php +++ b/src/Http/Controllers/StyleController.php @@ -13,10 +13,8 @@ class StyleController extends Controller */ public function __invoke(Request $request) { - $cssPath = LaRecipe::allStyles()[$request->style] ?? abort(404); - return response( - file_get_contents($cssPath), + file_get_contents(LaRecipe::allStyles()[$request->style] ?? abort(404)), 200, ['Content-Type' => 'text/css'] );