mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-24 03:59:08 -05:00
add: restrict bon upload purchases if buffer is too high
This commit is contained in:
@@ -71,6 +71,10 @@ class TransactionController extends Controller
|
||||
|
||||
switch (true) {
|
||||
case $bonExchange->upload:
|
||||
if (config('other.bon.max-buffer-to-buy-upload') !== null && $user->uploaded - $user->downloaded > config('other.bon.max-buffer-to-buy-upload')) {
|
||||
return back()->withErrors('You already have enough buffer.');
|
||||
}
|
||||
|
||||
$user->increment('uploaded', $bonExchange->value);
|
||||
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user