示例#1
0
 /**
  * Handles routing to single and multiple document delete requests
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy()
 {
     // Runs filters.
     if ($result = $this->checkVersion()) {
         return $result;
     }
     $singleDelete = \LockerRequest::hasParam($this->identifier);
     if ($singleDelete) {
         $data = $this->getShowData();
     } else {
         $data = $this->getIndexData();
     }
     return $this->completeDelete($data, $singleDelete);
 }
示例#2
0
 public function get()
 {
     return \LockerRequest::hasParam($this->identifier) ? $this->show() : $this->index();
 }
 /**
  * Retrieves attached file content
  * @param string $name Field name
  * @return Array
  */
 public function getAttachedContent($name = 'content')
 {
     if (\LockerRequest::hasParam('method') || $this->method === 'POST') {
         return $this->getPostContent($name);
     } else {
         $contentType = \LockerRequest::header('Content-Type', 'text/plain');
         return ['content' => \LockerRequest::getContent(), 'contentType' => $contentType];
     }
 }