Update
This commit is contained in:
@@ -37,12 +37,12 @@ public function isExpired(): bool
|
||||
|
||||
public function isUsed(): bool
|
||||
{
|
||||
return !is_null($this->used_at);
|
||||
return ! is_null($this->used_at);
|
||||
}
|
||||
|
||||
public function isValid(): bool
|
||||
{
|
||||
return !$this->isExpired() && !$this->isUsed();
|
||||
return ! $this->isExpired() && ! $this->isUsed();
|
||||
}
|
||||
|
||||
public function markAsUsed(): void
|
||||
@@ -53,11 +53,11 @@ public function markAsUsed(): void
|
||||
public function scopeExpiredAndUnused($query)
|
||||
{
|
||||
return $query->where('expires_at', '<', now())
|
||||
->whereNull('used_at');
|
||||
->whereNull('used_at');
|
||||
}
|
||||
|
||||
public function scopeForUser($query, $userId)
|
||||
{
|
||||
return $query->where('user_id', $userId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user