Proje: Okul Platform · Hub: Okul Platform — Domain

VerificationService

app/Services/VerificationService.php — E-posta ve telefon doğrulama.

OTP’den farklı: Bu sistem bir hesap özelliğini (e-posta, telefon) doğrulamak için kullanılır. OTP ise login için kullanılır.

Doğrulama Akışı

  1. POST /api/verification → Kod gönder
  2. POST /api/verification/{code} → Kodu doğrula

Exception’lar

AttemptLimitException           — Çok fazla deneme
InvalidVerificationCodeException — Hatalı kod
InvalidVerifyException           — Geçersiz doğrulama isteği
RecordAlreadyVerifiedException   — Zaten doğrulanmış
ResendTimeLimitException         — Tekrar gönderme süresi dolmadı
VerificationCodeAlreadySentException — Kod zaten gönderildi
VerificationTimeExpiredException  — Doğrulama süresi doldu
InvalidVerifiableTypeArgument    — Hatalı doğrulama tipi

Events

  • SendVerificationCodeEvent — Kod gönderildi
  • VerifiedCodeEvent — Kod doğrulandı

Note: VerificationService fluent API — $service->setUserId()->setType()->generateAndSendCode()