PHP code example of grupodkt / notification-channel-sms

1. Go to this page and download the library: Download grupodkt/notification-channel-sms 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/ */

    

grupodkt / notification-channel-sms example snippets


// config/services.php
...
'sms' => [
    'url'   => env('SMS_URL'),
    'token' => env('SMS_TOKEN'),
    'phoneNumberId' => env('SMS_PHONE_NUMBER_ID'),
],
...

use NotificationChannels\Sms\SmsChannel;
use NotificationChannels\Sms\SmsMessage;
use Illuminate\Notifications\Notification;

class AccountApproved extends Notification
{
    public function via($notifiable)
    {
        return [SmsChannel::class];
    }

    public function toSms($notifiable)
    {
        return (new SmsMessage())
            ->content("Your {$notifiable->service} account was approved!");
    }
}

public function routeNotificationForSms()
{
    return $this->celular;
}