Пример #1
0
 /**
  * @param string $method
  * @param bool   $hasBody
  *
  * @return \Unirest\Response
  */
 protected function send($method = 'get', $hasBody = false)
 {
     if ($hasBody) {
         $response = $this->request->{$method}($this->url(), $this->headers, $this->resource->encode());
     } else {
         $response = $this->request->{$method}($this->url(), $this->headers);
     }
     return $response;
 }
 /**
  * @param \Codecasts\Restinga\Contracts\Data\Resource $resource
  *
  * @return \Codecasts\Restinga\Contracts\Data\Resource
  */
 public function childResource(ResourceContract $resource)
 {
     $resource->setParentResource($this);
     return $resource;
 }