src/Twilio.php
public function sendMessage(TwilioMessage $message, $to, $useAlphanumericSender = false)
    {
        if ($message instanceof TwilioSmsMessage) {
            if ($useAlphanumericSender && $sender = $this->getAlphanumericSender()) {
                $message->from($sender);
            }

            return $this->sendSmsMessage($message, $to);
        }

        if ($message instanceof TwilioCallMessage) {
            return $this->makeCall($message, $to);
        }

        throw CouldNotSendNotification::invalidMessageObject($message);
    }
public function sendMessage(TwilioMessage $message, $to, $useAlphanumericSender = false)
    {
        if ($message instanceof TwilioSmsMessage) {
            if ($useAlphanumericSender && $sender = $this->getAlphanumericSender()) {
                $message->from($sender);
            }

            return $this->sendSmsMessage($message, $to);
        }

        if ($message instanceof TwilioCallMessage) {
            return $this->makeCall($message, $to);
        }

        throw CouldNotSendNotification::invalidMessageObject($message);
    }
public function sendMessage ( TwilioMessage $ message , $ to , $ useAlphanumericSender = false ) { if ( $ message instanceof TwilioSmsMessage ) { if ( $ useAlphanumericSender && $ sender = $ this -> getAlphanumericSender ( ) ) { $ message -> from ( $ sender ) ; } return $ this -> sendSmsMessage ( $ message , $ to ) ; } if ( $ message instanceof TwilioCallMessage ) { return $ this -> makeCall ( $ message , $ to ) ; } throw CouldNotSendNotification :: invalidMessageObject ( $ message ) ; }
Send a TwilioMessage to the a phone number.

@param  TwilioMessage $message
@param  string $to
@param bool $useAlphanumericSender
@return mixed
@throws \Twilio\Exceptions\TwilioException
Send a TwilioMessage to the a phone number .