public function getContent()
    {
        //Convert non scalar responses
        if ($this->content && !is_scalar($this->content) && !$this->json) {
            $this->toJson();
        }

        if (($this->json || $this->request->wantsJson()) && !is_scalar($this->content)) {
            if ($this->content instanceof Collection) {
                return json_encode($this->content->toArray());
            } else {
                return json_encode((array) $this->content);
            }
        } else {
            return $this->content;
        }
    }
public function getContent()
    {
        //Convert non scalar responses
        if ($this->content && !is_scalar($this->content) && !$this->json) {
            $this->toJson();
        }

        if (($this->json || $this->request->wantsJson()) && !is_scalar($this->content)) {
            if ($this->content instanceof Collection) {
                return json_encode($this->content->toArray());
            } else {
                return json_encode((array) $this->content);
            }
        } else {
            return $this->content;
        }
    }
public function getContent ( ) { //Convert non scalar responses if ( $ this -> content && ! is_scalar ( $ this -> content ) && ! $ this -> json ) { $ this -> toJson ( ) ; } if ( ( $ this -> json || $ this -> request -> wantsJson ( ) ) && ! is_scalar ( $ this -> content ) ) { if ( $ this -> content instanceof Collection ) { return json_encode ( $ this -> content -> toArray ( ) ) ; } else { return json_encode ( ( array ) $ this -> content ) ; } } else { return $ this -> content ; } }
Get content of this response object.

@return string
Get content of this response object .