src/Sms/Twilio.php
public function send(array $data)
    {
        $text = self::sanitizeText($data['text']);
        $to   = preg_replace("/[(,),\-,\s]/", "", $data['to']);
        $from = preg_replace("/[(,),\-,\s]/", "", $data['from']);

        $this->client->messages->create($to, ['from' => $from, 'body' => $text]);

        return true;
    }
public function send(array $data)
    {
        $text = self::sanitizeText($data['text']);
        $to   = preg_replace("/[(,),\-,\s]/", "", $data['to']);
        $from = preg_replace("/[(,),\-,\s]/", "", $data['from']);

        $this->client->messages->create($to, ['from' => $from, 'body' => $text]);

        return true;
    }
public function send ( array $ data ) { $ text = self :: sanitizeText ( $ data [ 'text' ] ) ; $ to = preg_replace ( "/[(,),\-,\s]/" , "" , $ data [ 'to' ] ) ; $ from = preg_replace ( "/[(,),\-,\s]/" , "" , $ data [ 'from' ] ) ; $ this -> client -> messages -> create ( $ to , [ 'from' => $ from , 'body' => $ text ] ) ; return true ; }
Send a sms using Twilio Rest API

@param array $data ['text', 'to', 'from'] Key-value array
* 'text' - message that will be sent
* 'to'     - number without country code,
* 'from' - number that will send the message,

@return bool
Send a sms using Twilio Rest API