Delete a redirect

@param int $id

@return RedirectResponse
770125
public function deleteAction($id)
    {
        $manager = $this->get('opifer.redirect.redirect_manager');

        $redirect = $manager->getRepository()->find($id);

        $manager->remove($redirect);
        $this->addFlash('success', $this->get('translator')->trans('opifer_redirect.flash.deleted'));

        return $this->redirectToRoute('opifer_redirect_redirect_index');
    }
515855
public function actionDelete($id)
    {
        // delete profile and userTokens first to handle foreign key constraint
        $user = $this->findModel($id);
        $profile = $user->profile;
        $userToken = $this->module->model("UserToken");
        $userAuth = $this->module->model("UserAuth");
        $userToken::deleteAll(['user_id' => $user->id]);
        $userAuth::deleteAll(['user_id' => $user->id]);
        $profile->delete();
        $user->delete();

        return $this->redirect(['index']);
    }
542137
public function destroy($id)
      {
        if ( \Auth::user()->roles[0]->can('menu-delete' ) ) {
          $this->menus->findOrFail($id)->delete();
          return \Redirect::route('admin.menus.index', [
            ])->withMessage(trans('acl::menu.menus-controller-successfully_deleted'));
          }
          return \Redirect::route('admin.menus.index')->withErrors(trans('acl::dashboard.unauthorized_access'));
        }
743033
public function destroy($id)
    {
    	$role = Role::findOrFail($id);
		$role->delete();
		
		return redirect(url("role"))->with('dp_announce', trans('deeppermission.alert.role.deleted'));
    }
30402
public function actionDelete($id)
	{
		//$this->loadModel($id)->delete();

		// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser
		//if(!isset($_GET['ajax']))
		//	$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));
                
                
                
                $model = $this->loadModel($id);
				
		$sql = 'ALTER TABLE '.BaseCccdCompanyData::model()->tableName().' DROP `'.$model->varname.'`';
				if ($model->dbConnection->createCommand($sql)->execute()) {
					$model->delete();
				}
			

		// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser
		if(!isset($_POST['ajax']))
				$this->redirect(array('admin'));
		
		else
			throw new CHttpException(400,'Invalid request. Please do not repeat this request again.');
	

	}
701352
public function destroy($id)
    {
        try
        {
            $this->groups->delete($id);

            return Redirect::route('cpanel.groups.index')
                ->with('success', Lang::get('cpanel::groups.delete_success'));
        }
        catch (GroupNotFoundException $e)
        {
            return Redirect::back()->with('error', $e->getMessage());
        }
    }
1302021
public
    function destory($id)
    {
        $row = Model::find($id);
        $row->delete();
        flash()->success('Your Item Deleted');
        return redirect()->to("/menus");
    }
259232
public function actionRemovelocation($id)
  {
    $date = new DateTime();
    $model = $this->findModel($id);
    $model->time_deleted = $date->format('U');
    $model->save();
    return $this->redirect(['/site/index']);
  }
1271644
public function actionDelete($id)
    {
        $this->findModel($id)->delete();
        Yii::$app->getSession()->setFlash('success', Yii::t('system', 'Delete success.'));
        return $this->redirect(['index']);
    }
93757
public function destroy($id)
    {
        $this->service->destroy($id);
        flash()->success('Se ha eliminado el artículo');
        return redirect()->to('backend/blog');
    }
1040194
public function handleDelete(int $id = null)
    {
        if ($id === null) {
            if (isset($_GET['template']) === false) {
                return redirect($this->router->generate('users-list-page') . "?m=2");
            } else {
                return 'Redirect: ' . $this->router->generate('users-list-page') . "?m=2";
            }
        } elseif ($id === $this->core->auth()->details->id) {
            if (isset($_GET['template']) === false) {
                return redirect($this->router->generate('users-list-page') . "?m=3");
            } else {
                return 'Redirect: ' . $this->router->generate('users-list-page') . "?m=3";
            }
        }
        $user = $this->core->api('User/' . $id, 'DELETE')->run();
        if ($user['headers'][0][2] === 422) {
            if (isset($_GET['template']) === false) {
                return redirect($this->router->generate('users-list-page') . "?m=2");
            } else {
                return 'Redirect: ' . $this->router->generate('users-list-page') . "?m=2";
            }
        } elseif (($user["headers"][0][2] - 200) * ($user["headers"][0][2] - 299) > 0) {
            if (headers_sent() === false) {
                foreach ($response["headers"] as $header) {
                    header($header[0], $header[1], $header[2]);
                }
            }
            return $this->templates->render("500", [
                "error" => $user['response'],
                "result" => ''
            ]);
        }

        if (isset($_GET['template']) === false) {
            return redirect($this->router->generate('users-list-page') . "?m=1");
        } else {
            return 'Redirect: ' . $this->router->generate('users-list-page') . "?m=1";
        }
    }
275245
public function actionDelete($id)
    {
        $model = $this->findModel($id);
        Configs::authManager()->remove($model->item);
        Helper::invalidate();

        return $this->redirect(['index']);
    }
1047130
public function deleteById($id)
    {
        $deleteResult = $this->getRequest()->request(
            'DELETE',
            $this->getRequestUrl(sprintf('inputs/%s', $id))
        );

        return $deleteResult['status'];
    }
1175433
public function delete($id = null) {
        $role = $this->Roles->get($id);
        if ($this->request->is(['patch', 'post', 'put'])) {
            if ($this->Roles->delete($role)) {
                $this->Flash->success(__('The role has been deleted.'));
            } else {
                $this->Flash->error(__('The role could not be deleted. Please, try again.'));
            }
            return $this->redirect(['action' => 'index']);
        }
        $this->set(compact('role'));
    }
1332345
public function delete($id)
    {
        try {
            $this->userRepositoryInterface->delete($id);
        } catch (UsersException $e) {
            Flash::error($e->getMessage());

            return redirect()->route('users.index');
        }

        Flash::success(trans('dashboard::dashboard.flash.user.delete.success'));

        return redirect()->route('users.index');
    }
809512
public function delete(int $id)
    {
        return self::$curl->post(self::DELETE.self::$access_token, json_encode([
                'tag' => [
                    'id' => $id,
                ],
            ]
        ));
    }
1023142
public function actionDelete($id)
    {
        $this->findModel($id)->updateAttributes(['status' => User::STATUS_DELETED]);

        return $this->redirect(['index']);
    }