update: transaction controller

- Like the logic for sending invites. If invites are in restricted mode, dont allow a non whitelisted group to buy invites from the store.
This commit is contained in:
HDVinnie
2024-07-03 21:31:52 -04:00
parent a590766ac1
commit 19b172f397
@@ -100,6 +100,10 @@ class TransactionController extends Controller
break;
case $bonExchange->invite:
if (config('other.invites_restriced') && !\in_array($user->group->name, config('other.invite_groups'), true)) {
return back()->withErrors(trans('user.invites-disabled-group'));
}
if ($user->invites >= config('other.max_unused_user_invites', 1)) {
return back()->withErrors('You already have the maximum amount of unused invites allowed per user.');
}