temporary invite

This commit is contained in:
xiaomlove
2022-12-13 13:51:39 +08:00
parent 6fa604ce56
commit f413c61901
42 changed files with 727 additions and 47 deletions

View File

@@ -360,6 +360,15 @@ class User extends Authenticatable implements FilamentUser, HasName
return $this->belongsTo(User::class, 'invited_by');
}
public function temporary_invites()
{
return $this->hasMany(Invite::class, 'inviter')
->where('invitee', '')
->whereNotNull('expired_at')
->where('expired_at', '>=', Carbon::now())
;
}
public function send_messages()
{
return $this->hasMany(Message::class, 'sender');