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;
        }
    }