Undo
This commit is contained in:
parent
3a9c7964b6
commit
903d766906
|
|
@ -15,10 +15,9 @@ class KeyController extends Controller
|
||||||
{
|
{
|
||||||
$fetchKeys = InviteKey::where('created_by', Auth::id())->latest()->get();
|
$fetchKeys = InviteKey::where('created_by', Auth::id())->latest()->get();
|
||||||
$activeKey = InviteKey::where('created_by', Auth::id())->latest()->first();
|
$activeKey = InviteKey::where('created_by', Auth::id())->latest()->first();
|
||||||
$userJoin = User::where('created_at', Auth::id())
|
|
||||||
|
|
||||||
if (!$fetchKeys->isEmpty()) {
|
if (!$fetchKeys->isEmpty()) {
|
||||||
if ($activeKey->created_at->addWeek()->gt(Carbon::now()) || !$userJoin->addWeek()->gt(Carbon::now())) {
|
if ($activeKey->created_at->addWeek()->gt(Carbon::now())) {
|
||||||
$canCreate = false;
|
$canCreate = false;
|
||||||
if (User::isAdmin()) {
|
if (User::isAdmin()) {
|
||||||
if ($activeKey->created_at->addMinute()->gt(Carbon::now())) {
|
if ($activeKey->created_at->addMinute()->gt(Carbon::now())) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue