src/Watchers/RequestWatcher.php
protected function response(Response $response)
    {
        $content = $response->getContent();

        if (is_string($content) &&
            is_array(json_decode($content, true)) &&
            json_last_error() === JSON_ERROR_NONE) {
            return $this->contentWithinLimits($content)
                    ? $this->hideParameters(json_decode($content, true), Telescope::$hiddenResponseParameters)
                    : 'Purged By Telescope';
        }

        if ($response instanceof RedirectResponse) {
            return 'Redirected to '.$response->getTargetUrl();
        }

        if ($response instanceof IlluminateResponse && $response->getOriginalContent() instanceof View) {
            return [
                'view' => $response->getOriginalContent()->getPath(),
                'data' => $this->extractDataFromView($response->getOriginalContent()),
            ];
        }

        return 'HTML Response';
    }
protected function response(Response $response)
    {
        $content = $response->getContent();

        if (is_string($content) &&
            is_array(json_decode($content, true)) &&
            json_last_error() === JSON_ERROR_NONE) {
            return $this->contentWithinLimits($content)
                    ? $this->hideParameters(json_decode($content, true), Telescope::$hiddenResponseParameters)
                    : 'Purged By Telescope';
        }

        if ($response instanceof RedirectResponse) {
            return 'Redirected to '.$response->getTargetUrl();
        }

        if ($response instanceof IlluminateResponse && $response->getOriginalContent() instanceof View) {
            return [
                'view' => $response->getOriginalContent()->getPath(),
                'data' => $this->extractDataFromView($response->getOriginalContent()),
            ];
        }

        return 'HTML Response';
    }
protected function response ( Response $ response ) { $ content = $ response -> getContent ( ) ; if ( is_string ( $ content ) && is_array ( json_decode ( $ content , true ) ) && json_last_error ( ) === JSON_ERROR_NONE ) { return $ this -> contentWithinLimits ( $ content ) ? $ this -> hideParameters ( json_decode ( $ content , true ) , Telescope :: $ hiddenResponseParameters ) : 'Purged By Telescope' ; } if ( $ response instanceof RedirectResponse ) { return 'Redirected to ' . $ response -> getTargetUrl ( ) ; } if ( $ response instanceof IlluminateResponse && $ response -> getOriginalContent ( ) instanceof View ) { return [ 'view' => $ response -> getOriginalContent ( ) -> getPath ( ) , 'data' => $ this -> extractDataFromView ( $ response -> getOriginalContent ( ) ) , ] ; } return 'HTML Response' ; }
Format the given response object.

@param  \Symfony\Component\HttpFoundation\Response  $response
@return array|string
Format the given response object .