PHP code example of aldemeery / bulksms-notification-channel

1. Go to this page and download the library: Download aldemeery/bulksms-notification-channel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

aldemeery / bulksms-notification-channel example snippets


'providers' => [
    // ...
    Aldemeery\BulkSMS\BulkSMSChannelServiceProvider::class,
];

'bulk_sms' => [
    'username'  =>  env('BULK_SMS_USERNAME'),
    'password'  =>  env('BULK_SMS_PASSWORD'),
    'sms_from'  =>  env('BULK_SMS_FROM'),
    'base_url'  =>  env('BULK_SMS_BASEURL'),
],

/**
 * Get the notification routing information for the Bulk SMS driver.
 *
 * @param \Illuminate\Notifications\Notification|null $notification Notification instance.
 *
 * @return  mixed
 */
public function routeNotificationForBulkSms($notification = null)
{
	return  $this->phone_number; // or whatever field name that has the phone number.
}

/**
 * Get the BulkSMS representation of the notification.
 *
 * @param mixed $notifiable Notifiable instance.
 *
 * @return \Aldemeery\BulkSMS\Messages\BulkSMSMessage
 */
public function toBulkSms($notifiable)
{
	return new BulkSMSMessage('Your verification code is 1234');
}

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