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