...
'providers' => [
...
NotificationChannels\Epochta\EpochtaServiceProvider::class,
],
...
// config/services.php
...
'epochta' => [
'sms' => [
'public_key' => env('EPOCHTA_SMS_PUBLIC_KEY'),
'private_key' => env('EPOCHTA_SMS_PRIVATE_KEY'),
],
],
...
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.