mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-11-22 16:23:18 +01:00
Refactor LogoService resolution
This commit is contained in:
parent
d6fd8e3c52
commit
7ce7067380
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user