Add invite-only registration mode

This commit is contained in:
Constantin Graf
2026-08-31 13:14:09 +02:00
parent 303de4930d
commit 3161bbef4a
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();
}