PHP code example of rezahmady / smsir

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

    

rezahmady / smsir example snippets


public function routeNotificationForSmsir()
{
    return $this->mobile;
}

namespace App\Notifications\Sms;

use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Rezahmady\Smsir\SmsirChannel;
use Rezahmady\Smsir\SmsirMessage;

class VerificationCode extends Notification
{
    use Queueable;

    public $parameter;

    /**
     * Create a new notification instance.
     *
     * @return void
     */
    public function __construct($parameter)
    {
        $this->parameter = $parameter;
    }

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

    public function toSmsir($notifiable)
    {
        return (new SmsirMessage())
                ->setMethod('ultraFastSend')
                ->setTemplateId('47119')
                ->setParameters([
                    'VerificationCode' => $this->parameter
                ]);
        
    }

}