This is a major release of laravel-fast2sms focused on WhatsApp Business
API support, a richer exception hierarchy, expressive testing utilities, and
modern PHP 8.3+ patterns throughout.
⚠️ This release contains breaking changes. Please read the Upgrade Guide before updating.
🚀 WhatsApp Business API — Send text, image, document, location, interactive,
reaction, sticker, and template messages via Fast2sms::viaWhatsApp().
🔔 Laravel Notification Channels — Drop-in SmsChannel and WhatsAppChannel
for use with Laravel's built-in notification system.
🧱 Typed Exception Hierarchy — Catch exactly what you need:
AuthenticationException, RateLimitException, ServerException,
NetworkException, ValidationException, ConfigurationException,
DuplicateSendException, InsufficientBalanceException, ThrottleExceededException.
🧪 Rich Fake Assertions — 16 new Fast2smsFake assertion methods for
expressive, readable test code. Plus stopFaking() for clean test teardown.
💡 Fluent Message Builders — SmsMessage and WhatsAppMessage with named
constructors and chainable setters. SmsMessage also ships with credit helpers:
charCount(), isUnicode(), creditCount(), exceedsOneSms().
⚙️ New Artisan Commands
fast2sms:events — lists all dispatchable events with descriptionsfast2sms:ide-helper — generates _ide_helper_fast2sms.php for full IDE autocompletion📦 Queue Support — onQueue() / onConnection() fluent API with built-in
validation.
🧩 PHP 8.3+ Patterns — readonly class DTOs, backed enums, and typed
returns throughout.
🐘 PHP 8.4 & 8.5 Support — CI matrix extended and fully tested.
🌐 Laravel 13 Support — Compatible with Laravel 11, 12, and 13.
| Guard | Config Key | What it does |
|---|---|---|
| Recipient deduplication | fast2sms.recipients.deduplicate |
Strips duplicate numbers before every send |
| Invalid recipient stripping | fast2sms.validation.strip_invalid_recipients |
Validates numbers, logs warnings, throws if all invalid |
| Idempotency guard | fast2sms.deduplication.* |
Blocks repeated (recipients + message + route) within a TTL window |
| Rate throttle | fast2sms.throttle.* |
Sliding-window per-minute cap via Laravel cache |
| Balance gate | fast2sms.balance_gate.* |
Checks wallet before send; fires LowBalanceDetected, optionally throws |
| Batch splitting | fast2sms.recipients.batch_size |
Splits large recipient lists into chunks automatically |
Fast2smsException is now final
Extend a specific subtype (ApiException, NetworkException, etc.) instead.
DTOs are readonly class
Fast2smsConfig, SmsParameters, and WhatsAppParameters properties cannot
be mutated after construction — reconstruct the DTO instead.
ConfigValidator::validate() now throws ConfigurationException
instead of \InvalidArgumentException — update your catch blocks.
ResponseFactory throws ApiException on unknown response types
instead of UnhandledMatchError.
Fast2smsFake recorded calls are typed value objects
Use sentSms() / sentWhatsApp() accessors instead of accessing
$fake->recorded directly.
SmsChannel / WhatsAppChannel throw \LogicException when the
notifiable is missing the required routing method — implement
routeNotificationForFast2sms() / routeNotificationForWhatsapp().
All public API methods now return ResponseInterface instead of the
concrete Fast2smsResponse — update type-hints accordingly.
The public sending API —
Fast2sms::quick(),::dlt(),::otp(),::viaWhatsApp()— is completely unchanged.
These methods still work but will be removed in v3.0.0:
| Deprecated | Replacement |
|---|---|
SmsMessage::content() |
SmsMessage::withContent() |
SmsMessage::route() |
SmsMessage::withRoute() |
SmsMessage::to() |
SmsMessage::withNumbers() |
HttpClient no longer retries on 4xx — only 5xx and connection failuresResponseFactory no longer throws UnhandledMatchError on unknown response typesManagesSms::setDlt no longer overwrites the message body with the DLT template IDHttpClient::upload now guards against missing or unreadable files with a descriptive exceptionSendRateThrottle replaced non-atomic cache pattern with RateLimiter to eliminate a race conditionAppliesSendGuards writes the dedup cache only after a successful send, so failed sends don't block retriesFast2smsServiceProvider::boot now correctly skips config validation only during unit tests, not all console commandsManagesWhatsAppActions dispatches WhatsAppFailed on exceptionLowBalanceDetected now correctly uses Dispatchable + SerializesModelsManagesSms::executeSend is now a descriptive Fast2smsExceptionafterApiCall() trigger in executeApiCall finally block removed| v1.x | v2.0.0 | |
|---|---|---|
| Tests | 88 | 229 |
| Assertions | — | 453 |
New coverage includes DTOs, enums, exceptions, responses, events, jobs,
channels, fake assertions, and LogClient.
See UPGRADING.md for a step-by-step migration guide from v1.x to v2.0.0.
Full Changelog: https://github.com/itxshakil/laravel-fast2sms/blob/main/CHANGELOG.md
fast2sms_logs table.LogSmsSent and LogSmsFailed event listeners.log driver for local development to prevent credit wastage.Http::retry() (3 attempts, 100ms backoff).Fast2smsException.SmsChannel to support SmsMessage objects with recipient data.to() and send() methods in SmsMessage.Collection in to() method.Fast2smsPhone validation rule for Indian mobile numbers.Fast2smsResponse with dynamic property access and json() method.Full Changelog: https://github.com/itxshakil/laravel-fast2sms/compare/v1.1.0...v1.2.0
Full Changelog: https://github.com/itxshakil/laravel-fast2sms/compare/v1.1.1...v1.1.2
Full Changelog: https://github.com/itxshakil/laravel-fast2sms/compare/v1.0.0...v1.1.0
How can I help you explore Laravel packages today?