Sindbad~EG File Manager

Current Path : /home/zada/www/app/Services/OTP/
Upload File :
Current File : /home/zada/www/app/Services/OTP/Twillo.php

<?php

namespace App\Services\OTP;

use App\Contracts\SendSms;
use Twilio\Rest\Client;

class Twillo implements SendSms
{

    public function send($to, $from, $text, $template_id)
    {
        $sid = env("TWILIO_SID"); // Your Account SID from www.twilio.com/console
        $token = env("TWILIO_AUTH_TOKEN"); // Your Auth Token from www.twilio.com/console
        $type = env("TWILLO_TYPE"); // sms type

        $client = new Client($sid, $token);
        try {
            $client->messages->create(
                ($type == 1) ? $to : "whatsapp:" . $to, // Text this number
                array(
                    'from' =>  ($type == 1) ? env('VALID_TWILLO_NUMBER') : "whatsapp:" . env('VALID_TWILLO_NUMBER'), // From a valid Twilio number
                    'body' => $text
                )
            );
        } catch (\Exception $e) {
        }
    }
}

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists (>^ω^<)看过哭02teddd(>^ω^<)看过哭02teddd