original_string: public function delete($id, IndexListener $listener)
      {
          try {
              $model = $this->repository->makeModel()->findOrFail($id);
              $model->delete();
              return $listener->deleteSuccess();
          } catch (Exception $ex) {
              return $listener->deleteFailed();
          }
      }
code: public function delete($id, IndexListener $listener)
      {
          try {
              $model = $this->repository->makeModel()->findOrFail($id);
              $model->delete();
              return $listener->deleteSuccess();
          } catch (Exception $ex) {
              return $listener->deleteFailed();
          }
      }
code_tokens: public function delete ( $ id , IndexListener $ listener ) { try { $ model = $ this -> repository -> makeModel ( ) -> findOrFail ( $ id ) ; $ model -> delete ( ) ; return $ listener -> deleteSuccess ( ) ; } catch ( Exception $ ex ) { return $ listener -> deleteFailed ( ) ; } }
docstring: deletes custom notification
  
  @param mixed $id
  @param IndexListener $listener
  @return RedirectResponse
docstring_tokens: deletes custom notification