public function device(?int $id = null): ?array
    {
        if (is_null($id)) {
            $id = $this->device;
        }

        $key = sprintf('smsgatewayme.device.%s', $id);
        $device = Cache::remember($key, 3600 * 24 * 7, function () use (&$response, $id) {
            $response = Request::get($this->baseUrl.'device/'.$id);

            if ($response->code != 200) {
                if (!empty($response->body->message)) {
                    Log::error($response->body->message);
                }
            }

            return $response->body;
        });

        return [
            'code'    => $response->code ?? 200,
            'message' => 'OK',
            'data'    => $device,
        ];
    }
public function device(?int $id = null): ?array
    {
        if (is_null($id)) {
            $id = $this->device;
        }

        $key = sprintf('smsgatewayme.device.%s', $id);
        $device = Cache::remember($key, 3600 * 24 * 7, function () use (&$response, $id) {
            $response = Request::get($this->baseUrl.'device/'.$id);

            if ($response->code != 200) {
                if (!empty($response->body->message)) {
                    Log::error($response->body->message);
                }
            }

            return $response->body;
        });

        return [
            'code'    => $response->code ?? 200,
            'message' => 'OK',
            'data'    => $device,
        ];
    }
public function device ( ? int $ id = null ) : ? array { if ( is_null ( $ id ) ) { $ id = $ this -> device ; } $ key = sprintf ( 'smsgatewayme.device.%s' , $ id ) ; $ device = Cache :: remember ( $ key , 3600 * 24 * 7 , function ( ) use ( & $ response , $ id ) { $ response = Request :: get ( $ this -> baseUrl . 'device/' . $ id ) ; if ( $ response -> code != 200 ) { if ( ! empty ( $ response -> body -> message ) ) { Log :: error ( $ response -> body -> message ) ; } } return $ response -> body ; } ) ; return [ 'code' => $ response -> code ?? 200 , 'message' => 'OK' , 'data' => $ device , ] ; }
Get device information.

@return object|null
Get device information .