Download the PHP package enio1910/laravel-smsapi-notification-channel without Composer
On this page you can find all versions of the php package enio1910/laravel-smsapi-notification-channel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download enio1910/laravel-smsapi-notification-channel
More information about enio1910/laravel-smsapi-notification-channel
Files in enio1910/laravel-smsapi-notification-channel
Package laravel-smsapi-notification-channel
Short Description A Laravel Notification Channel for SMSAPI
License MIT
Homepage https://github.com/ENIO1910/laravel-smsapi-notification-channel
Informations about the package laravel-smsapi-notification-channel
SMSAPI Notification Channel for Laravel
This package makes it easy to send SMS and MMS notifications using SMSAPI with Laravel 11, 12, and 13.
Installation
If you are using Laravel without package auto-discovery, add the service provider to config/app.php:
Publish the config:
Configuration
Configure config/smsapi.php:
Or set only .env values:
The package uses the official smsapi/php-client v3 adapter internally.
service=plusessmsapiPlService()service=comusessmsapiComService()- if
uriis set, the package uses the matching*ServiceWithUri()variant - MMS sending is available only for
service=pl, because the official SMSAPI client exposesmmsFeature()only there
Response DTO
The channel returns NotificationChannels\SmsApi\Dto\SmsApiResponse.
For real SMSAPI sends the package maps the response returned by smsapi/php-client and normalizes it to:
statusCode: local adapter status, currently200when the SMSAPI client accepted the send requestdecoded.id: SMS/MMS identifierdecoded.points: charged pointsdecoded.number: recipient numberdecoded.status: SMS/MMS status returned by SMSAPIdecoded.idx: external identifier if presentdecoded.date_sent: ISO-8601 sent date if available
This is adapter-level data, not the raw HTTP response from SMSAPI.
Usage
To send the notification, call notify() on your model:
The model you call notify() on must use the Illuminate\Notifications\Notifiable trait.
For on-demand notifications, you can use the channel class directly:
Example:
If you do not pass the recipient directly with to(), you must define the recipient on the notifiable model:
This method name is kept for compatibility. The package supports SmsApiChannel::class for via() and on-demand Notification::route(), while model-based routing still resolves through routeNotificationForSmsApi().
In practice, a complete notifiable model can look like this:
Or provide the recipient directly in the message:
If you use to(), routeNotificationForSmsApi() is not required for that notification.
Bulk SMS Usage
To send one SMS to many recipients in a single SMSAPI request, use toMany():
You can also return an array from routeNotificationForSmsApi():
Bulk sending is available for SMS messages. MMS still requires a single recipient.
MMS Usage
To send an MMS, switch the message to MMS mode with mms($subject, $smil):
- The SMIL payload should use the
SMIL 1.0standard. - If the MMS references files by path or URL, that path must be publicly accessible.
You can still use to() to set the recipient explicitly:
Any additional MMS-specific parameters supported by SMSAPI can be passed with set($key, $value).
All versions of laravel-smsapi-notification-channel with dependencies
guzzlehttp/guzzle Version ^7.0
illuminate/notifications Version ^11.0 || ^12.0 || ^13.0
illuminate/support Version ^11.0 || ^12.0 || ^13.0
smsapi/php-client Version ^4.0.0