Skip to content

Commit

Permalink
Move abort inline with previous code
Browse files Browse the repository at this point in the history
  • Loading branch information
wsamoht committed Oct 26, 2024
1 parent 71a774a commit ba64bad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/Http/Controllers/ScriptController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']
);
Expand Down
4 changes: 1 addition & 3 deletions src/Http/Controllers/StyleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']
);
Expand Down

0 comments on commit ba64bad

Please sign in to comment.