PHP code example of premgthb / exabytes-sms

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

    

premgthb / exabytes-sms example snippets




namespace App\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Premgthb\ExabytesSms\Notifications\ExabytesSmsChannel;

class ExabytesSmsNotification extends Notification
{
    use Queueable;

    public $content;

    public function __construct($message)
    {
        $this->message = $message;
    }

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

     /**
      * Get SMS Message content
      */
    public function toExabytes($notifiable)
    {
       return $this->message;
    }
}

public function routeNotificationForExabytes()
{
   return preg_replace('/\D+/', '', '6'.$this->mobile_number);
}

Notification::route('exabytes', $mobileNumber)->notify(new ExabytesSmsNotification($yourMessage));


use Exabytes;

$otp = Exabytes::generateOtp();

$data = [ 'to' => $request->mobile_number , 'msg' => $request->message ]

Exabytes::sendMessage($data);
code
php artisan vendor:publish --provider="Premgthb\ExabytesSms\ExabytesServiceProvider"
code
php artisan make:notification ExabytesSmsNotification