/**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id)
 {
     try {
         return $this->service->update($request->all(), $id);
     } catch (ModelNotFoundException $e) {
         return "Task not found";
     }
 }
 public function update(array $data, $id_project, $id_file)
 {
     try {
         $this->validator->with($data)->passesOrFail(ValidatorInterface::RULE_UPDATE);
         $file = $this->repository->update($data, $id_file);
         return $file;
     } catch (ValidatorException $e) {
         return ['error' => true, 'message' => $e->getMessageBag()];
     }
 }
 public function update(array $data, $project_id, $task_id)
 {
     try {
         $data['project_id'] = $project_id;
         $this->validator->with($data)->passesOrFail(ValidatorInterface::RULE_UPDATE);
         return $this->repository->update($data, $task_id);
     } catch (ValidatorException $e) {
         return ['error' => true, 'message' => $e->getMessageBag()];
     } catch (ModelNotFoundException $e) {
         return ['error' => true, 'message' => 'A tarefa que está tentando atualizar não existe'];
     }
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id, $taskId)
 {
     if ($this->checkProjectPermissions($id) == false) {
         return ['error' => 'Access Forbidden'];
     }
     $this->service->destroy($taskId);
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  Request  $request
  * @param  int  $id
  * @return Response
  */
 public function update(Request $request, $id)
 {
     $projectTask = $this->repository->skipPresenter()->find($id);
     $projectId = $projectTask->project_id;
     if ($this->checkProjectTaskPermissions($projectId) == false) {
         return ['error' => 'Access Forbidden'];
     }
     return $this->service->update($request->all(), $id);
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  int                      $id
  *
  * @param                           $taskId
  *
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id, $taskId)
 {
     $data = $request->all();
     $data['project_id'] = $id;
     if ($this->projectService->checkProjectPermissions($id) == false) {
         return ['error' => 'Access forbidden'];
     }
     return $this->service->update($data, $taskId);
 }
 public function delete($id)
 {
     $entity = Project::find($id);
     if (is_null($entity)) {
         return Errors::invalidId($id);
     }
     foreach ($entity->tasks as $task) {
         $this->projectTaskService->delete($task->id);
     }
     foreach ($entity->memberAssociations as $pm) {
         $this->projectMemberService->delete($pm->id);
     }
     $this->repository->delete($id);
     return ['message' => "Registro deletado!"];
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id, $idTask)
 {
     $this->service->delete($idTask);
     //$this->repository->delete($idTask);
     /*
     //return $this->repository->delete($taskId);
     
     $projectTask = $this->repository->skipPresenter()->find($id);
     //$result = $this->repository->delete($id);
     
     $projectId = $projectTask->project_id;
     
     if($this->checkProjectTaskPermissions($projectId) == false){
         return ['error' => 'Access Forbidden'];
     }
     
     $result = $projectTask->delete();
     
     if($result)
         return ['error' => 0];
     
     return  ['error' => 1, 'msg' => 'Erro ao tentar deletar a Task'];
     */
 }
 /**
  * @param Request $request
  * @param $id
  * @return mixed
  */
 public function update(Request $request, $id, $taskId)
 {
     return $this->service->update($request->all(), $id, $taskId);
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id, $idTask)
 {
     $this->service->delete($idTask);
 }
 public function recentTasks()
 {
     return $this->service->all();
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  Request $request
  * @param  int $id
  * @return Response
  */
 public function update(Request $request, $id, $taskId)
 {
     return $this->service->update($request->all(), $taskId);
     //$this->repository->find($id)->update($request->all());
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  * @param $idTask
  * @return Response
  */
 public function destroy($id, $idTask)
 {
     $this->service->delete($idTask);
     //$this->repository->find($idTask)->delete();
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id, $idTask)
 {
     $data = $request->all();
     $data['project_id'] = $id;
     return $this->service->update($data, $idTask);
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($project_id, $task_id)
 {
     return $this->service->destroy($project_id, $task_id);
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $taskId
  * @return Response
  */
 public function destroy($taskId)
 {
     return $this->service->destroy($taskId);
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     return $this->service->delete($id);
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id, $taskId)
 {
     $this->service->delete($taskId);
 }