App\Ninja\Intents\BaseIntent::createResponse PHP Method

createResponse() protected method

protected createResponse ( $type, $content )
    protected function createResponse($type, $content)
    {
        $response = new SkypeResponse($type);
        if (is_string($content)) {
            $response->setText($content);
        } else {
            if ($content instanceof \Illuminate\Database\Eloquent\Collection) {
                // do nothing
            } elseif (!is_array($content)) {
                $content = [$content];
            }
            foreach ($content as $item) {
                $response->addAttachment($item);
            }
        }
        return json_encode($response);
    }