Add invite-only registration mode

This commit is contained in:
Constantin Graf
2026-08-31 13:14:09 +02:00
committed by Constantin Graf
parent 3ec2abb309
commit 637475e669
12 changed files with 82 additions and 17 deletions

View File

@@ -18,10 +18,19 @@ use Illuminate\Support\Facades\Mail;
class InvitationService
{
public function hasInvitationForEmail(string $email): bool
public function hasAcceptedInvitationForEmail(string $email): bool
{
return OrganizationInvitation::query()
->whereRaw('lower(email) = ?', [strtolower($email)])
->whereNotNull('accepted_at')
->exists();
}
public function hasPendingInvitationForEmail(string $email): bool
{
return OrganizationInvitation::query()
->whereRaw('lower(email) = ?', [strtolower($email)])
->whereNull('accepted_at')
->exists();
}