protected function respond()
    {
        $response = [];

        if (!empty($this->meta)) {
            $response['meta'] = $this->meta;
        }

        $response['data'] = $this->data;

        if ($this->data instanceof Arrayable) {
            $response['data'] = $this->data->toArray();
        }

        return Response::json($response, $this->statusCode, $this->headers);
    }
protected function respond()
    {
        $response = [];

        if (!empty($this->meta)) {
            $response['meta'] = $this->meta;
        }

        $response['data'] = $this->data;

        if ($this->data instanceof Arrayable) {
            $response['data'] = $this->data->toArray();
        }

        return Response::json($response, $this->statusCode, $this->headers);
    }
protected function respond ( ) { $ response = [ ] ; if ( ! empty ( $ this -> meta ) ) { $ response [ 'meta' ] = $ this -> meta ; } $ response [ 'data' ] = $ this -> data ; if ( $ this -> data instanceof Arrayable ) { $ response [ 'data' ] = $ this -> data -> toArray ( ) ; } return Response :: json ( $ response , $ this -> statusCode , $ this -> headers ) ; }
Build the response.

@return \Illuminate\Http\Response
Build the response .