This package makes it easy to send notifications using Lox24 with Laravel 5.3.
You can install the package via composer:
composer require laravel-notification-channels/lox24
Add your Lox24 Account ID and your Lox24 password to your broadcasting config:
// config/broadcasting.php
'connections' =>
'lox24' => [
'accountId' => env('LOX24_ACCOUNT_ID'),
'password' => env('LOX24_PASSWORD'),
'from' => env('LOX24_FROM'), // optional sender name
]
Now you can use the channel in your via() method inside the notification:
use NotificationChannels\Lox24\Lox24Channel;
use NotificationChannels\Lox24\Lox24Message;
use Illuminate\Notifications\Notification;
class AccountApproved extends Notification
{
public function via($notifiable)
{
return [Lox24Channel::class];
}
public function toLox24($notifiable)
{
return Lox24Message::create()
->setText("Your account was approved!")
->setFrom('YOUR SITE');
}
}
In order to let your Notification know to which mobile phone number to send the SMS add routeNotificationForLox24
method to your Notifiable model.
You must return phone number.
public function routeNotificationForLox24()
{
return $this->mobile_phone; // For examle 0049123456789
}
Do not forget to add the Service Provider:
NotificationChannels\Lox24\Lox24ServiceProvider::class
setText('hello you!')
: Accepts a string value for the SMS Text.setTo('0049123456789')
: Accepts a string value with the receiver phone number.setFrom('sendername')
: Accepts a string value (max 11 characters) with a sender name which will be displayed on receivers phone as sendertestOnly()
: Can be used for testing, no SMS will be sentsendAt(\DateTime $time)
: Can be used to schedule sending
Please see CHANGELOG for more information what has changed recently.
$ composer test
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.