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