From 599d742e96bf4f0ff9a0226556c9cf8be282e37d Mon Sep 17 00:00:00 2001 From: Miguel Nogueira Date: Sun, 28 Jun 2020 00:46:49 +0100 Subject: [PATCH] Use UUID conversion facade --- app/Http/Middleware/UsernameUUID.php | 8 ++------ public/css/home.css | 1 + 2 files changed, 3 insertions(+), 6 deletions(-) create mode 100644 public/css/home.css diff --git a/app/Http/Middleware/UsernameUUID.php b/app/Http/Middleware/UsernameUUID.php index 4df5965..2463df6 100644 --- a/app/Http/Middleware/UsernameUUID.php +++ b/app/Http/Middleware/UsernameUUID.php @@ -3,6 +3,7 @@ namespace App\Http\Middleware; use Closure; +use App\Facades\UUID; use Illuminate\Support\Facades\Http; class UsernameUUID @@ -19,13 +20,8 @@ class UsernameUUID $input = $request->all(); if (isset($input['uuid'])) { - // TODO: Switch to custom Facade $username = $input['uuid']; - - $conversionRequest = Http::get(config('general.urls.mojang.api') . '/users/profiles/minecraft/' . $username)->body(); - $decodedConversionRequest = json_decode($conversionRequest, true); - - $input['uuid'] = $decodedConversionRequest['id']; + $input['uuid'] = UUID::toUUID($username); $request->replace($input); } diff --git a/public/css/home.css b/public/css/home.css new file mode 100644 index 0000000..b5d81d8 --- /dev/null +++ b/public/css/home.css @@ -0,0 +1 @@ +.full-img-bg