From f331049ec03c35e0e6534bfdde6861d0507cb083 Mon Sep 17 00:00:00 2001 From: Hiekki <72362116+Hiekki4@users.noreply.github.com> Date: Sun, 25 Jul 2021 23:38:12 +0100 Subject: [PATCH] AVMG --- app/Http/Controllers/Api/UserController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Api/UserController.php b/app/Http/Controllers/Api/UserController.php index aed2c10c..55c2c595 100644 --- a/app/Http/Controllers/Api/UserController.php +++ b/app/Http/Controllers/Api/UserController.php @@ -78,8 +78,8 @@ class UserController extends Controller $request->validate([ "credits" => "required|numeric|min:0|max:1000000", ]); - - if ($request->user()->credits + $request->credits >= 99999999) throw ValidationException::withMessages([ + + if ($user->credits + $request->credits >= 99999999) throw ValidationException::withMessages([ 'credits' => "You can't add this amount of credits because you would exceed the credit limit" ]);