/**
  * @param array $data
  * @param $id
  * @return array|mixed
  * @throws ValidatorException
  */
 public function update(array $data, $id)
 {
     try {
         $this->validator->with($data)->setId($id)->passesOrFail();
         $this->repository->update($data, $id);
     } catch (ValidatorException $e) {
         return ['error' => true, 'message' => $e->getMessageBag()];
     }
 }