public function request($verb, array $params = []) { parent::request($verb, $params); if ($verb == \Carbo\Http\Verb::Post) { $file = $_FILES['file']; move_uploaded_file($file['tmp_name'], $this->folder->path . DIRECTORY_SEPARATOR . $file['name']); $this->headers['Location'] = '..'; $this->code = \Carbo\Http\Code::Found; } }
public function response() { if (!$this->created) { return parent::response(['item' => $this->item]); } }