This commit is contained in:
Thomas G 2022-10-06 15:07:34 +11:00
parent 7bc465f6dc
commit 3a9c7964b6
1 changed files with 2 additions and 1 deletions

View File

@ -15,9 +15,10 @@ class KeyController extends Controller
{
$fetchKeys = InviteKey::where('created_by', Auth::id())->latest()->get();
$activeKey = InviteKey::where('created_by', Auth::id())->latest()->first();
$userJoin = User::where('created_at', Auth::id())
if (!$fetchKeys->isEmpty()) {
if ($activeKey->created_at->addWeek()->gt(Carbon::now())) {
if ($activeKey->created_at->addWeek()->gt(Carbon::now()) || !$userJoin->addWeek()->gt(Carbon::now())) {
$canCreate = false;
if (User::isAdmin()) {
if ($activeKey->created_at->addMinute()->gt(Carbon::now())) {