PHP code example of pyaesone17 / sms-poh

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

    

pyaesone17 / sms-poh example snippets

 bash
$ php artisan vendor:publish
 php
$results = SmsPohFacade::fetch(1);
 php
$sms = app()->make(pyaesone17\SmsPoh\SmsPoh::class);
$results = $sms->fetch(1);
 php
$resutls = fetch_smspoh(1);
 php
$sms = app()->make(pyaesone17\SmsPoh\SmsPoh::class);
$results = $sms->send(
    ['+959790646062','+95943160544'],
    'Nice to meet you'
);
 php
$results = send_smspoh(
    ['+959790646062','+95943160544'],
    'Nice to meet you'
);
 php

class SendSmsPohNotification extends Notification
{
    use Queueable;

    public $message;

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

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

    /**
     * Get the sms representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function toMMSms($notifiable)
    {
        return [
            'message' => $this->message,
            'to' => '+959790646062',
            'test' => 1,
            'callback' => function (...$result)
            {
                // After sms is being sent or failed
                // The callback will fire, here you can
                // do whatever you want with the result.
                // If you don't want, just pass as null
                dd($result);
            }
        ];
    }