src/Provider/Sms4BD.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 = [
            'publickey' => $config['publickey'],
            'privatekey' => $config['privatekey'],
            'type' => $config['type'],
            'sender' => $config['sender'],
            'delay' => $config['delay'],
            'receiver' => $number,
            'message' => $text,
        ];
        $response = Request::get('http://www.sms4bd.net', $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 = [ 'publickey' => $ config [ 'publickey' ] , 'privatekey' => $ config [ 'privatekey' ] , 'type' => $ config [ 'type' ] , 'sender' => $ config [ 'sender' ] , 'delay' => $ config [ 'delay' ] , 'receiver' => $ number , 'message' => $ text , ] ; $ response = Request :: get ( 'http://www.sms4bd.net' , $ 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
/*$client = new Client([
            'base_uri' => 'http://www.sms4bd.net',
            'timeout' => 10.0,
        ]);

        try {
            $response = $client->request('GET', '', [
                'query' => [
                    'publickey' => $config['publickey'],
                    'privatekey' => $config['privatekey'],
                    'type' => $config['type'],
                    'sender' => $config['sender'],
                    'delay' => $config['delay'],
                    'receiver' => $number,
                    'message' => $text,
                ]
            ]);
        } catch (GuzzleException $e) {

            $data['number'] = $number;
            $data['message'] = $text;
            $report = $this->generateReport($e->getMessage(), $data);
            return $report->getContent();
        }
*/