PHP code example of xefi / sms-factor-notification-channel

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

    

xefi / sms-factor-notification-channel example snippets


/**
 * Get the notification's delivery channels.
 *
 * @return array<int, string>
 */
public function via(object $notifiable): array
{
    return ['sms-factor'];
}

use Xefi\SmsFactor\Messages\SmsFactorMessage;
 
/**
 * Get the SMSFactor representation of the notification.
 */
public function toSmsFactor(object $notifiable): SmsFactorMessage
{
    return (new SmsFactorMessage)
                ->text('Your SMS message content');
}

use Illuminate\Notifications\Notification;

/**
 * Get the corresponding phone number for the current model.
 */
public function routeNotificationForSmsFactor(Notification $notification)
{
    return $this->phone;
}

use Xefi\SmsFactor\Messages\SmsFactorMessage;
 
/**
 * Get the SMSFactor representation of the notification.
 */
public function toSmsFactor(object $notifiable): SmsFactorMessage
{
    return (new SmsFactorMessage)
                ->content('Your SMS message content')
                ->sender('15554443333');
}