Overview
Twilio is used exclusively for phone number verification via the Verify V2 API. No voice calls or general SMS messaging. File:app/Models/Services/Integrations/TwilioService.php
SDK: twilio/sdk v6.9
Configuration
config/services.php under twilio key.
How it works
Step 1: Request verification code
Endpoint:GET /api/mobile-numbers/code
Step 2: Verify code
Endpoint:GET /api/mobile-numbers/verify
MobileNumber model is updated with a verified_at timestamp.
Mobile number model
File:app/Models/v1/MobileNumber.php
store()— creates new mobile number recordstoreAndVerify()— creates and immediately marks as verifiedisTaken()— checks if number is already registeredexistsForUserId()— checks if user already has a number
MobileNumberUpdated event on update → triggers UpdatePaymentMobileNumber listener which syncs the phone number to Stripe.
Endpoints
Both verification endpoints are public (no auth required):| Endpoint | Method | Purpose |
|---|---|---|
/api/mobile-numbers/code | GET | Send verification SMS |
/api/mobile-numbers/verify | GET | Validate verification code |
/api/v1/mobile-numbers/code and /api/v1/mobile-numbers/verify.