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()];
     }
 }
 public function destroy($id)
 {
     try {
         //Buscando dados do Projeto
         $projects = new Project();
         $p = $projects->where('client_id', $id)->get();
         //removendo notas do projeto
         $notes = new ProjectNote();
         foreach ($p as $project) {
             $notes->where('project_id', $project->id)->delete();
         }
         //removendo projeto
         $projects->where('client_id', $id)->delete();
         //removendo client
         $this->repository->find($id)->delete();
         return json_encode(['success' => 'user removed']);
     } catch (\Exception $e) {
         return json_encode(['error' => 'Project not found', 'msg' => $e->getMessage()]);
     }
 }