Esempio n. 1
0
 /**
  * @param int $id
  *
  * @return mixed
  * @throws BadDataQueryException
  */
 public function restore($id)
 {
     if ($this->hasDeleteTrait($this->modelInstance)) {
         $this->modelInstance = $this->modelInstance->withTrashed()->findOrFail($id);
         return $this->modelInstance->restore();
     }
     $message = 'Table `%s` do not contains deleted records';
     $message = sprintf($message, $this->getTable());
     throw new BadDataQueryException($this, $message);
 }