yhshanto/itech-sms-channel

Itech flexible sms Notification Channel for laravel.

v2.0.0 2020-09-15 05:13 UTC

This package is auto-updated.

Last update: 2024-04-15 13:30:07 UTC


README

Installation

composer require yhshanto/itech-sms-channel

Configuration

You must add bellow code to your config/services.php

'itech' => [
    'sms' => [
        'endpoint' => 'https://api.infobip.com/api/v3/sendsms/plain?user=demo&password=demo&sender=Azzoa&SMSText=[message]&GSM=[to]&type=longSMS'
    ]
]

[message] will replaced by original message [to] will replaced by notifiable route

Add itech in via method of your notification class

/**
 * Get the notification's delivery channels.
 *
 * @param  mixed  $notifiable
 * @return array
 */
public function via($notifiable)
{
    return ['itech'];
}

also add this method in your notification class which will return a sms string

/**
 * Get the sms representation of the notification.
 *
 * @param  mixed  $notifiable
 * @return array|MailMessage|\NotificationChannels\Fcm\FcmMessage
 */
public function toItechSms($notifiable)
{
    return 'Write somthing here';
}

You must have phone attribute or routeNotificationForItech method (return a valid phone number) in your notifiable class like App\User