From 7ce706738065c8e25c8836b44e0fc7c04577c5d0 Mon Sep 17 00:00:00 2001 From: Bubka <858858+Bubka@users.noreply.github.com> Date: Wed, 23 Nov 2022 15:47:20 +0100 Subject: [PATCH] Refactor LogoService resolution --- app/Api/v1/Controllers/IconController.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/Api/v1/Controllers/IconController.php b/app/Api/v1/Controllers/IconController.php index 579345a7..c53dcb80 100644 --- a/app/Api/v1/Controllers/IconController.php +++ b/app/Api/v1/Controllers/IconController.php @@ -5,7 +5,6 @@ use App\Http\Controllers\Controller; use App\Services\LogoService; use Illuminate\Http\Request; -use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\Storage; class IconController extends Controller @@ -34,16 +33,16 @@ public function upload(Request $request) * Fetch a logo * * @param \Illuminate\Http\Request $request + * @param \App\Services\LogoService $logoService * @return \Illuminate\Http\JsonResponse */ - public function fetch(Request $request) + public function fetch(Request $request, LogoService $logoService) { $this->validate($request, [ 'service' => 'string|regex:/^[^:]+$/i', ]); - $logoService = App::make(LogoService::class); - $icon = $logoService->getIcon($request->service); + $icon = $logoService->getIcon($request->service); return $icon ? response()->json(['filename' => $icon], 201)