karabinse / telnect-sms
Send SMS text message using Telnect API
Requires
- php: >=8.1
- guzzlehttp/guzzle: ^7.10
- illuminate/notifications: ^10.0 || ^11.0 || ^12.0 || ^13.0
- illuminate/support: ^10.0 || ^11.0 || ^12.0 || ^13.0
Requires (Dev)
- laravel/pint: ^1.29
- mockery/mockery: ^1.0
- orchestra/testbench: ^8.0 || ^9.0 || ^10.0 || ^11.0
- phpunit/phpunit: ^10.0
README
This package makes it easy to send notifications using [TelnectSms](link to service) with Laravel 10.x. Tested on PHP 8.4 and PHP 8.5.
This package provides a Laravel notification channel for sending SMS messages via the Telnect API. It integrates with Laravel's notification system, allowing you to send SMS notifications by adding the TelnectSms channel to your notifiable classes.
Contents
Installation
composer require karabinse/telnect-sms --update-with-dependencies
Setting up the TelnectSms service
You need to obtain an API key from Telnect. You can contact via this form
Add your Telnect API to services.php
<?php
return [
// ...
'telnect_sms' => [
'api_key' => env('TELNECT_SMS_API_KEY'),
],
];
Usage
Now you can use the channel in your via() method inside the notification:
<?php
use Karabin\TelnectSms\TelnectSmsChannel;
use Karabin\TelnectSms\TelnectSmsMessage;
use Illuminate\Notifications\Notification;
class AccountApproved extends Notification
{
public function via($notifiable)
{
return [SnsChannel::class];
}
public function toTelnectSms($notifiable)
{
return TelnectSmsMessage::create()
->body('Your account is created and ready to be used')
->sender('MyBusiness');
}
}
Testing
$ composer test
Security
If you discover any security related issues, please email info@karabin.se instead of using the issue tracker.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.