public function update(Request $request, $id)
 {
     try {
         $this->checkPermissions($this->repository->find($id)->project_id);
         $this->service->update($request->all(), $id);
     } catch (\Exception $e) {
         return ['error' => $e->getMessage()];
     }
 }
 public function update(array $data, $id)
 {
     try {
         $this->validator->with($data)->passesOrFail();
         return $this->repository->find($id)->update($data);
     } catch (ValidatorException $e) {
         return ['error' => true, 'message' => $e->getMessage()];
     }
 }