Download the PHP package software-technologies-limited/sms without Composer
On this page you can find all versions of the php package software-technologies-limited/sms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download software-technologies-limited/sms
More information about software-technologies-limited/sms
Files in software-technologies-limited/sms
Package sms
Short Description Laravel package for integrating sms notifications
License MIT
Homepage https://github.com/Software-Technologies-Limited/sms
Informations about the package sms
software-technologies-limited/sms
Laravel package for sending SMS via Africa's Talking and Twilio.
Requirements
- PHP 8.1+
- Laravel 10/11/12/13
Repository: Software-Technologies-Limited/sms.
The PHP namespace is StlHorizon\Sms. When upgrading from earlier releases,
update imports and custom driver references to this namespace.
Installation from Packagist
Once the repository is submitted to Packagist under the new name:
Installation (local path)
1) Add repository and require the package in your app composer.json:
2) Install:
Configuration
Publish the config (optional):
Add credentials to your .env:
Twilio (optional):
Optional overrides:
Usage
Facade
Sending happens immediately in the current request; no Laravel queue worker is required. The sandbox username automatically selects the sandbox API endpoint unless an endpoint is explicitly configured.
Drivers
Set the default driver in .env:
Use Twilio:
To add another driver, define it in config/sms.php under drivers with a class key that implements StlHorizon\\Sms\\Contracts\\SmsDriver, then set SMS_DRIVER to that name.
Send with a template
Dependency Injection
Per-call options
Notifications (SmsChannel)
To resolve the phone number, implement routeNotificationForSms() on your notifiable or provide a phone / phone_number field.
Logging
Migrations are disabled by default. Installing the package or running your application's
normal migrations will not create the package's table unless you explicitly enable
SMS_LOAD_MIGRATIONS=true.
For guided setup, run:
This publishes configuration and asks whether to create the package's SMS log table.
The default answer is No. Choose No for eBoard, which already has ebr_sms_outbox.
Choosing Yes runs only the package migration on the default database and skips it if the
configured log table already exists. When using this optional table, set SMS_LOGGING=true.
Webhook (delivery reports)
Enable in .env:
This registers a POST endpoint that stores the payload in sms_logs (when logging is enabled).
Response format
send() returns a structured array:
The Africa's Talking driver also returns recipients and error. Each recipient contains the
gateway's number, status, statusCode, messageId, and cost when supplied.
success is true only when the HTTP request succeeds and every recipient is accepted with
status code 100 or 101. Acceptance is not confirmation of handset delivery. Connection failures return
success = false and status = 0; they are not automatically retried.
For eBoard, retain the existing tenant ebr_sms_outbox table as the send log. Map recipient
results to to, status, status_code, messageId, and cost; the application supplies
id_user, id_company, notification_type, id, message, from, and time_sent.
This mapping must be implemented in the consuming application's notification flow.
Disable the package's separate logging table and migration registration when using it:
Notes
- Ensure your sender ID (
AFRICASTALKING_FROM) is approved in Africa's Talking. - For production, use your live username and API key (not the sandbox).
- Twilio requires either
TWILIO_FROMorTWILIO_MESSAGING_SERVICE_SID.
Testing (package)
License
MIT
All versions of sms with dependencies
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/http Version ^10.0|^11.0|^12.0|^13.0
illuminate/notifications Version ^10.0|^11.0|^12.0|^13.0
illuminate/database Version ^10.0|^11.0|^12.0|^13.0
illuminate/routing Version ^10.0|^11.0|^12.0|^13.0