Download the PHP package connectmedia/laravel without Composer
On this page you can find all versions of the php package connectmedia/laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download connectmedia/laravel
More information about connectmedia/laravel
Files in connectmedia/laravel
Package laravel
Short Description Laravel integration for the Connect Media SMS API: send bulk and transactional SMS and SMS notifications to Safaricom, Airtel and Telkom in Kenya.
License MIT
Homepage https://connectmedia.co.ke/developers/
Informations about the package laravel
Connect Media SMS for Laravel
Send SMS and SMS notifications from Laravel with Connect Media, a Kenyan bulk SMS provider delivering to Safaricom, Airtel and Telkom numbers and to 190+ countries. Built on the official connectmedia/sms PHP client.
ConnectMedia::send('0712345678', 'Hello')from anywhere in your app- A notification channel so
$user->notify(...)can go out by SMS, queued or not - Kenyan numbers normalised for you (
0712…,+254 712…,254712…) - Default sender ID from config, scheduling, balance, sent history and replies
php artisan connectmedia:testto check your setup in seconds
Supports Laravel 10, 11 and 12 on PHP 8.1+.
Installation
Add your credentials to .env:
Get an API key by creating a free account at app.connectmedia.co.ke and generating one under Profile, then API keys. Your sender ID must be registered first; see sender IDs.
Check everything works:
To customise settings, publish the config file:
Sending SMS
You can also type-hint ConnectMedia\Laravel\ConnectMedia for dependency injection.
Notifications
Add toConnectMedia() to a notification and put 'connectmedia' in via():
toConnectMedia() may also return a plain string.
Tell Laravel which number to use on your notifiable model:
If you don't define it, the channel uses the model's phone_number or phone attribute. Notifiables without a number are skipped.
On-demand notifications work too:
Implement ShouldQueue (as above) to send large batches through your queue workers.
Errors
API errors throw ConnectMedia\Sms\ConnectMediaException with $e->apiCode and $e->apiMessage, for example 100 invalid API key, 101 insufficient balance, 104 invalid recipients. A missing API key throws a RuntimeException telling you to set CONNECTMEDIA_API_KEY.
Testing
Links
- Connect Media developer docs
- Bulk SMS API for Kenya
- Pricing: no minimum top-up, credit never expires
- Other SDKs: PHP, Python, Node.js
License
MIT. See LICENSE.
All versions of laravel with dependencies
connectmedia/sms Version ^10.0
illuminate/console Version ^10.0|^11.0|^12.0
illuminate/notifications Version ^10.0|^11.0|^12.0
illuminate/support Version ^10.0|^11.0|^12.0