Easily send end-to-end encrypted notifications for Laravel using Signal.
- Set up signal-cli
This package requires signal-cli to communicate with the Signal service. Precompiled binaries are available here.
Extract the binary file to a directory of your choice. Signal-cli requires JRE 7 or newer.
-
Set your signal-cli and JAVA_HOME paths in SignalChannel.
-
Register your phone number (username) with the Signal service:
./signal-cli --username +12345556789 registerAdd your phone number (username) to .env:
SIGNAL_USERNAME="+12345556789" # Prefix ("+") and country code are required.use NotificationChannels\Signal\SignalChannel;
use NotificationChannels\Signal\SignalMessage;
use Illuminate\Notifications\Notification;
class AccountCreated extends Notification
{
use Queueable;
public function via($notifiable)
{
return [SignalChannel::class];
}
public function toSignal($notifiable)
{
return (new SignalMessage())
->message("This is a test Laravel notification message over Signal.")
->recipient("+12345556789");
}
Notifications will be sent to the recipient attribute of the Notifiable model.
message 'string'
recipient 'string'
Please see CHANGELOG for more information what has changed recently.
$ composer testIf you discover any security related issues, please email cjbarlow@protonmail.com instead of using the issue tracker.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.