src/Dispatcher.php
public function json($content)
    {
        if (is_array($content)) {
            $content = json_encode($content);
        }

        $this->content = $content;

        return $this->header('Content-Type', 'application/json');
    }
public function json($content)
    {
        if (is_array($content)) {
            $content = json_encode($content);
        }

        $this->content = $content;

        return $this->header('Content-Type', 'application/json');
    }
public function json ( $ content ) { if ( is_array ( $ content ) ) { $ content = json_encode ( $ content ) ; } $ this -> content = $ content ; return $ this -> header ( 'Content-Type' , 'application/json' ) ; }
Send a JSON payload in the request body.

@param string|array $content

@return \Dingo\Api\Dispatcher
Send a JSON payload in the request body .