tarre / laravel-notification-46elks
Laravel notification channel package for 46Elks.
Requires
- php: >=5.6.4
- guzzlehttp/guzzle: ^6.3
- illuminate/notifications: ^5.3|^6.0
- illuminate/support: ^5.3|^6.0
Requires (Dev)
- mockery/mockery: ^0.9.5
- phpunit/phpunit: 4.*
README
Here's the latest documentation on Laravel 5.3 Notifications System:
https://laravel.com/docs/master/notifications
46Elks notification channel for Laravel
This package makes it easy to send notifications using 46Elks with Laravel 5.3.
46Elks has a whole bunch of phone oriented services. This package takes care of:
- SMS
With more endpoints to come. Feel free to contribute.
Contents
Installation
composer require dalnix/46elks
Setting up the 46Elks service
add the following to your config/services.php
'46elks' => [
'username' => env('46ELKS_USERNAME'),
'password' => env('46ELKS_PASSWORD'),
],
Also remember to update your .env with correct information
Usage
To use this channel simply create a notification that has the following content:
public function via($notifiable)
{
return [FortySixElksChannel::class];
}
public function to46Elks($notifiable)
{
return (new FortySixElksSMS())
->line('Testsms')
->line('Olle')
->to('+46762216234')
->from('Emil');
}
The FortySixElksSMS have the following methods, all chainable.
Available Message methods
`from($mixed)
`. Accepts a string up to 11 characters or number. Sms will be sent with that name.
`to($number)
`. International phonenumber.
`line($string)
`. Every string in a line will be on its own row.
`flash()
`. Will set the messagetype to flash. Will not endup in sms inbox. See This tweet to find out how it looks on an iphone.
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Security
If you discover any security related issues, please email emil@dalnix.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.