CREDITS_DISPLAY_NAME

This commit is contained in:
AVMG20 2021-08-02 20:32:22 +02:00
parent 3f78d7dd1d
commit e9bc2e8827

View file

@ -143,14 +143,14 @@ class VoucherController extends Controller
]); ]);
if ($request->user()->credits + $voucher->credits >= 99999999) throw ValidationException::withMessages([ if ($request->user()->credits + $voucher->credits >= 99999999) throw ValidationException::withMessages([
'code' => "You can't redeem this voucher because you would exceed the credit limit" 'code' => "You can't redeem this voucher because you would exceed the ".CREDITS_DISPLAY_NAME." limit"
]); ]);
#redeem voucher #redeem voucher
$voucher->redeem($request->user()); $voucher->redeem($request->user());
return response()->json([ return response()->json([
'success' => "{$voucher->credits} credits have been added to your balance!" 'success' => "{$voucher->credits} ".CREDITS_DISPLAY_NAME." have been added to your balance!"
]); ]);
} }