protected function ping($route, $data = [])
    {
        if (! config('eyewitness.api_enabled', false)) {
            return [false, 'Api Disabled'];
        }

        $data['app_token'] = config('eyewitness.app_token');
        $data['secret_key'] = config('eyewitness.secret_key');
        $data['application_environment'] = app()->environment();
        $data['eyewitness_version'] = $this->eye->version();

        $this->headers['json'] = $data;

        for ($i=0; $i<3; $i++) {
            sleep($i);
            try {
                $response = $this->client->post($this->api."/$route", $this->headers);
                $result = [$response->getStatusCode(), $response->getReasonPhrase()];
                if ($result[0] == "200") {
                    return $result;
                }
            } catch (Exception $e) {
                $result = [false, $e->getMessage()];
            }
        }

        return $result;
    }
protected function ping($route, $data = [])
    {
        if (! config('eyewitness.api_enabled', false)) {
            return [false, 'Api Disabled'];
        }

        $data['app_token'] = config('eyewitness.app_token');
        $data['secret_key'] = config('eyewitness.secret_key');
        $data['application_environment'] = app()->environment();
        $data['eyewitness_version'] = $this->eye->version();

        $this->headers['json'] = $data;

        for ($i=0; $i<3; $i++) {
            sleep($i);
            try {
                $response = $this->client->post($this->api."/$route", $this->headers);
                $result = [$response->getStatusCode(), $response->getReasonPhrase()];
                if ($result[0] == "200") {
                    return $result;
                }
            } catch (Exception $e) {
                $result = [false, $e->getMessage()];
            }
        }

        return $result;
    }
protected function ping ( $ route , $ data = [ ] ) { if ( ! config ( 'eyewitness.api_enabled' , false ) ) { return [ false , 'Api Disabled' ] ; } $ data [ 'app_token' ] = config ( 'eyewitness.app_token' ) ; $ data [ 'secret_key' ] = config ( 'eyewitness.secret_key' ) ; $ data [ 'application_environment' ] = app ( ) -> environment ( ) ; $ data [ 'eyewitness_version' ] = $ this -> eye -> version ( ) ; $ this -> headers [ 'json' ] = $ data ; for ( $ i = 0 ; $ i < 3 ; $ i ++ ) { sleep ( $ i ) ; try { $ response = $ this -> client -> post ( $ this -> api . "/$route" , $ this -> headers ) ; $ result = [ $ response -> getStatusCode ( ) , $ response -> getReasonPhrase ( ) ] ; if ( $ result [ 0 ] == "200" ) { return $ result ; } } catch ( Exception $ e ) { $ result = [ false , $ e -> getMessage ( ) ] ; } } return $ result ; }
Send the ping notification to the Eyewitness.io API. Includes a 'backoff' retry
attempt if the inital pings fails.

@param  string  $route
@param  array   $data
@return mixed
Send the ping notification to the Eyewitness . io API . Includes a backoff retry attempt if the inital pings fails .