/**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($noteId, $id)
 {
     if ($this->checkProjectsOwner($id) == false) {
         return ['error' => 'Acesso Negado'];
     }
     $this->repository->find($noteId)->delete();
 }
 public function update(array $data, $id)
 {
     try {
         return $this->repository->update($data, $id);
     } catch (ValidatorException $e) {
         return ['error' => true, 'message' => $e->getMessageBag()];
     }
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($noteId)
 {
     $this->repository->find($noteId)->delete();
 }
 private function checkProjectMember($projectId)
 {
     $userId = \Authorizer::getResourceOwnerId();
     return $this->repository->hasMember($projectId, $userId);
 }