src/Provider/DianaHost.php
/**
     * Send Request To Api and Send Message
     */
Send Request To Api and Send Message
Send Request To Api and Send Message
public function sendRequest()
    {
        $number = $this->senderObject->getMobile();
        $text = $this->senderObject->getMessage();
        $config = $this->senderObject->getConfig();
        $query = [
            'api_key' => $config['api_key'],
            'type' => $config['type'],
            'senderid' => $config['senderid'],
            'contacts' => $number,
            'msg' => $text,
        ];
        $response = Request::get('http://esms.dianahost.com/smsapi', $query);
        $body = $response->getBody();
        $smsResult = $body->getContents();
        $data['number'] = $number;
        $data['message'] = $text;
        $report = $this->generateReport($smsResult, $data);
        return $report->getContent();
    }
public function sendRequest ( ) { $ number = $ this -> senderObject -> getMobile ( ) ; $ text = $ this -> senderObject -> getMessage ( ) ; $ config = $ this -> senderObject -> getConfig ( ) ; $ query = [ 'api_key' => $ config [ 'api_key' ] , 'type' => $ config [ 'type' ] , 'senderid' => $ config [ 'senderid' ] , 'contacts' => $ number , 'msg' => $ text , ] ; $ response = Request :: get ( 'http://esms.dianahost.com/smsapi' , $ query ) ; $ body = $ response -> getBody ( ) ; $ smsResult = $ body -> getContents ( ) ; $ data [ 'number' ] = $ number ; $ data [ 'message' ] = $ text ; $ report = $ this -> generateReport ( $ smsResult , $ data ) ; return $ report -> getContent ( ) ; }
Send Request To Api and Send Message
Send Request To Api and Send Message
//$requestUrl, array $query, bool $verify = false