https://github.com/laravel-notification-channels/turbosms
TurboSMS notification channel for Laravel
https://github.com/laravel-notification-channels/turbosms
laravel turbosms
Last synced: 8 months ago
JSON representation
TurboSMS notification channel for Laravel
- Host: GitHub
- URL: https://github.com/laravel-notification-channels/turbosms
- Owner: laravel-notification-channels
- License: mit
- Created: 2020-01-18T23:40:37.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2025-03-16T08:43:17.000Z (9 months ago)
- Last Synced: 2025-03-29T03:32:14.668Z (9 months ago)
- Topics: laravel, turbosms
- Language: PHP
- Homepage: https://laravel-notification-channels.com
- Size: 25.4 KB
- Stars: 5
- Watchers: 6
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# TurboSMS Notifications Channel for Laravel
[](https://packagist.org/packages/laravel-notification-channels/turbosms)
[](LICENSE.md)
[](https://travis-ci.org/laravel-notification-channels/turbosms)
[](https://styleci.io/repos/234812852)
[](https://scrutinizer-ci.com/g/laravel-notification-channels/turbosms)
[](https://scrutinizer-ci.com/g/laravel-notification-channels/turbosms/?branch=master)
[](https://packagist.org/packages/laravel-notification-channels/turbosms)
This package makes it easy to send notifications using [TurboSMS](https://turbosms.ua) with Laravel 5.5+, 6.0 and 7.0
## Contents
- [Installation](#installation)
- [Setting up the TurboSMS service](#setting-up-the-TurboSMS-service)
- [Usage](#usage)
- [ On-Demand Notifications](#on-demand-notifications)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)
## Installation
You can install this package via composer:
``` bash
composer require laravel-notification-channels/turbosms
```
### Setting up the TurboSMS service
Add your TurboSMS sms gate login, password and default sender name to your config/services.php:
```php
// config/services.php
...
'turbosms' => [
'wsdlEndpoint' => env('TURBOSMS_WSDLENDPOINT', 'http://turbosms.in.ua/api/wsdl.html'),
'login' => env('TURBOSMS_LOGIN'),
'password' => env('TURBOSMS_PASSWORD'),
'sender' => env('TURBOSMS_SENDER'),
'debug' => env('TURBOSMS_DEBUG', false), //will log sending attempts and results
'sandboxMode' => env('TURBOSMS_SANDBOX_MODE', false) //will not invoke API call
],
...
```
## Usage
You can use the channel in your via() method inside the notification:
```php
use Illuminate\Notifications\Notification;
use NotificationChannels\TurboSMS\TurboSMSMessage;
class AccountApproved extends Notification
{
public function via($notifiable)
{
return ["turbosms"];
}
public function toTurboSMS($notifiable)
{
return (new TurboSMSMessage("Your account was approved!"));
}
}
```
In your notifiable model, make sure to include a routeNotificationForTurboSMS() method, which returns a phone number or an array of phone numbers.
```php
public function routeNotificationForTurboSMS()
{
return $this->phone;
}
```
### On-Demand Notifications
Sometimes you may need to send a notification to someone who is not stored as a "user" of your application. Using the Notification::route method, you may specify ad-hoc notification routing information before sending the notification:
```php
Notification::route('turbosms', '+380501111111')
->notify(new AccountApproved());
```
## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
## Testing
``` bash
$ composer test
```
## Security
If you discover any security related issues, please email 1c.audit@gmail.com instead of using the issue tracker.
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## Credits
- [Vitalii Goncharov](https://github.com/gvital3230)
- [All Contributors](../../contributors)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.