fix: invitation
This commit is contained in:
@@ -19,4 +19,13 @@ class TeamInvitation extends Model
|
||||
{
|
||||
return $this->belongsTo(Team::class);
|
||||
}
|
||||
public function isValid() {
|
||||
$createdAt = $this->created_at;
|
||||
$diff = $createdAt->diffInMinutes(now());
|
||||
if ($diff <= config('constants.invitation.link.expiration')) {
|
||||
return true;
|
||||
} else {
|
||||
$this->delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user