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 user()
 {
     return $this->repository->belongsTo('App\\User', 'foreign_key');
 }