src/ResponseTrait.php
protected function respond($data, $headers = [])
    {
        $this->setResponseHeaders($headers);

        return response()->json($data, $this->getStatusCode(), $this->getResponseHeaders());
    }
protected function respond($data, $headers = [])
    {
        $this->setResponseHeaders($headers);

        return response()->json($data, $this->getStatusCode(), $this->getResponseHeaders());
    }
protected function respond ( $ data , $ headers = [ ] ) { $ this -> setResponseHeaders ( $ headers ) ; return response ( ) -> json ( $ data , $ this -> getStatusCode ( ) , $ this -> getResponseHeaders ( ) ) ; }
Returns JSON Encoded HTTP Reponse

@param  array $data
@param  array $headers
@return json
Returns JSON Encoded HTTP Reponse