src/Provider/GreenWeb.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 = [
            'token' => $config['token'],
            'to' => $number,
            'message' => $text,
        ];
        $response = Request::get('https://api.greenweb.com.bd/api.php?json', $query, false);
        $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 = [ 'token' => $ config [ 'token' ] , 'to' => $ number , 'message' => $ text , ] ; $ response = Request :: get ( 'https://api.greenweb.com.bd/api.php?json' , $ query , false ) ; $ 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