src/Http/Response.php
public function json(array $data = [], int $statusCode = 200)
    {
        $this->setContent(json_encode($data));
        $this->setStatusCode($statusCode);
        $this->json = true;

        return $this;
    }
public function json(array $data = [], int $statusCode = 200)
    {
        $this->setContent(json_encode($data));
        $this->setStatusCode($statusCode);
        $this->json = true;

        return $this;
    }
Json response

@param array $data
@param int   $statusCode

@return Response