public function send(array $destinations, string $text): ?array
    {
        $this->checkConfig();

        $messages = [];
        foreach ($destinations as $destination) {
            $messages[] = [
                'phone_number' => $destination,
                'message'      => $text,
                'device_id'    => $this->device,
            ];
        }

        $body = Body::json($messages);
        $response = Request::post($this->baseUrl.'message/send', [], $body);

        if ($response->code == 200) {
            return [
                'code'    => $response->code,
                'message' => 'OK',
                'data'    => $response->body,
            ];
        } else {
            if (!empty($response->body->message)) {
                Log::error($response->body->message);
            }

            return [
                'code'    => $response->code,
                'message' => $response->body->message ?? '',
                'data'    => $response->body,
            ];
        }
    }
public function send(array $destinations, string $text): ?array
    {
        $this->checkConfig();

        $messages = [];
        foreach ($destinations as $destination) {
            $messages[] = [
                'phone_number' => $destination,
                'message'      => $text,
                'device_id'    => $this->device,
            ];
        }

        $body = Body::json($messages);
        $response = Request::post($this->baseUrl.'message/send', [], $body);

        if ($response->code == 200) {
            return [
                'code'    => $response->code,
                'message' => 'OK',
                'data'    => $response->body,
            ];
        } else {
            if (!empty($response->body->message)) {
                Log::error($response->body->message);
            }

            return [
                'code'    => $response->code,
                'message' => $response->body->message ?? '',
                'data'    => $response->body,
            ];
        }
    }
public function send ( array $ destinations , string $ text ) : ? array { $ this -> checkConfig ( ) ; $ messages = [ ] ; foreach ( $ destinations as $ destination ) { $ messages [ ] = [ 'phone_number' => $ destination , 'message' => $ text , 'device_id' => $ this -> device , ] ; } $ body = Body :: json ( $ messages ) ; $ response = Request :: post ( $ this -> baseUrl . 'message/send' , [ ] , $ body ) ; if ( $ response -> code == 200 ) { return [ 'code' => $ response -> code , 'message' => 'OK' , 'data' => $ response -> body , ] ; } else { if ( ! empty ( $ response -> body -> message ) ) { Log :: error ( $ response -> body -> message ) ; } return [ 'code' => $ response -> code , 'message' => $ response -> body -> message ?? '' , 'data' => $ response -> body , ] ; } }
Send message to single number.

@param string $destination
@param string $text

@return object|null
Send message to single number .