Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/enniel/laravel-epochta-notification-channel
https://github.com/enniel/laravel-epochta-notification-channel
Last synced: 17 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/enniel/laravel-epochta-notification-channel
- Owner: enniel
- License: mit
- Created: 2016-10-20T12:40:56.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-21T07:53:51.000Z (about 8 years ago)
- Last Synced: 2024-12-06T17:29:34.389Z (about 1 month ago)
- Language: PHP
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Epochta notification channel for Laravel 5.3
This package makes it easy to send notifications using [Epochta aka Atompark](https://www.massmailsoftware.com/) with Laravel 5.3.
## Contents
- [Installation](#installation)
- [Setting up the configuration](#setting-up-the-configuration)
- [Usage](#usage)
- [Available Message methods](#available-message-methods)
- [Testing](#testing)
- [Credits](#credits)
- [License](#license)## Installation
You can install this package via composer:
``` bash
composer require enniel/laravel-epochta-notification-channel
```Next add the service provider to your `config/app.php`:
```php
...
'providers' => [
...
NotificationChannels\Epochta\EpochtaServiceProvider::class,
],
...
```### Setting up the configuration
Add your private and public keys to your `config/services.php`:
```php
// config/services.php
...
'epochta' => [
'sms' => [
'public_key' => env('EPOCHTA_SMS_PUBLIC_KEY'),
'private_key' => env('EPOCHTA_SMS_PRIVATE_KEY'),
],
],
...
```## Usage
Now you can use the channel in your `via()` method inside the notification:
``` php
use NotificationChannels\Epochta\EpochtaChannel;
use NotificationChannels\Epochta\EpochtaMessage;
use Illuminate\Notifications\Notification;class ExampleNotification extends Notification
{
public function via($notifiable)
{
return [EpochtaChannel::class];
}public function toEpochta($notifiable)
{
return (new EpochtaMessage())
->text('message text')
->sender('test');
}
}
```In order to let your Notification know which phone number you are targeting, add the `routeNotificationForEpochta` method to your Notifiable model.
### Available message methods
- `from()`: The identity of the sender.
- `text()`: The text of the message.
- `to()`: Recipient's phone number.
- `at()`: Sending a message at a specified time.
- `life()`: Life time SMS (0 = maximum, 1, 6, 12, 24 hours).
- `type()`: For Russia it is possible to specify the type of distribution type parameter.## Testing
``` bash
$ composer test
```## Credits
- [Evgeni Razumov](https://github.com/enniel)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.