Remove the specified resource from storage.

@param  \Illuminate\Http\Request  $request
@param  int  $id
@return \Illuminate\Http\Response
975139
public function destroy(Request $request, $id)
    {
        $tag = Tag::where(['id' => $id, 'user_id' => $request->user()->id])->firstOrFail();

        // Detach all tags from the did
        $tag->dids()->detach();

        $tag->delete();
    }
935260
public function deleteAction(Request $request, $id)
    {
        $mediaManager = $this->get('opifer.media.media_manager');
        $media = $mediaManager->getRepository()->find($id);

        $dispatcher = $this->get('event_dispatcher');
        $event = new MediaResponseEvent($media, $request);
        $dispatcher->dispatch(OpiferMediaEvents::MEDIA_CONTROLLER_DELETE, $event);

        if (null !== $event->getResponse()) {
            return $event->getResponse();
        }

        $mediaManager->remove($media);

        return $this->redirectToRoute('opifer_media_media_index');
    }
225396
public function removeitemAction(Request $request, $id) {
        $em = $this->getDoctrine()->getManager();

        $galleryItem = $em->getRepository('AmulenMediaBundle:GalleryItem')->find($id);

        $gallery = $galleryItem->getGallery();

        $em->remove($galleryItem);
        $em->flush();

        return $this->redirect($this->generateUrl('admin_gallery_items', array("id" => $gallery->getId())));
    }
1334882
public function deleteAction(Request $request, $id)
    {
        $this->checkAccess('DELETE', $id);
        $resource = $this->getResourceManager()->find($id);
        $this->getResourceManager()->remove($resource);
        $view = $this->view(null, \FOS\RestBundle\Util\Codes::HTTP_OK);
        return $this->handleView($view);
    }
436367
public function deleteAction(Request $request, $id)
    {
        /* @var $em EntityManager */
        $em = $this->getDoctrine()->getManager();

        $indexUrl = $this->getAdminListConfigurator()->getIndexUrl();
        if ($request->isMethod('POST')) {
            $em->getRepository('KunstmaanTranslatorBundle:Translation')->removeTranslations($id);
        }

        return new RedirectResponse($this->generateUrl($indexUrl['path'], isset($indexUrl['params']) ? $indexUrl['params'] : []));
    }
247061
public function destroy(Request $request, $id)
    {
        $deleted = (new Services\GroupsService)->dataDelete($id, $request->all());
        return response()->json(['deleted' => $deleted]);
    }
833995
public function delete(Request $request)
    {
        $this->validate(request(), [//@todo create custom Request class for page validation
            'page_id' => 'required',
        ]);
        
        $status = $this->page->deleteById($request->get('page_id'));
        return $status;
    }
50802
public function cdeleteAction($id, Request $request)
    {
        list($webspaceKey, $languageCode) = $this->getWebspaceAndLanguage($request);
        $path = $this->getRequestParameter($request, 'ids', true); // TODO rename path to id in all function names

        $this->getResourceLocatorRepository()->delete($path, $webspaceKey, $languageCode);
        $this->getDocumentManager()->flush();

        return $this->handleView($this->view());
    }
69045
public function deleteAction(Request $request, $id)
    {
        $configuration = $this->getConfiguration($request);
        $dispatcher = $configuration->getEventDispatcher();
        $object = $this->findObject($request, $id);

        $event = new PreFlushEvent($configuration, $request, $object);
        $dispatcher->dispatch(CrudEvents::PRE_FLUSH, $event);

        if ($event->hasResponse()) {
            return $event->getResponse();
        }

        $event = new PostFlushEvent($configuration, $request, $object);
        $om = $this->getObjectManager();
        $om->remove($object);

        try {
            $om->flush();
            $this->addFlash('success', sprintf('flash.%s.delete.success', $configuration->getName()));
        } catch (\Exception $e) {
            $event->setException($e);
            $this->addFlash('error', sprintf('flash.%s.delete.error', $configuration->getName()));
        }

        $dispatcher->dispatch(CrudEvents::POST_FLUSH, $event);

        if ($event->hasResponse()) {
            return $event->getResponse();
        }

        return $this->redirectToRoute(
            $configuration->getRoutePrefix() . 'index',
            $configuration->getRouteParameters()
        );
    }
1040015
public function deleteAction(
        int $id,
        Request $request
    ): Response {
        // Lookup the production by id.
        $production_repo = $this->em->getRepository(Production::class);
        if (null === $production = $production_repo->findOneBy(['id' => $id])) {
            throw new NotFoundHttpException();
        }

        // Create an empty form to submit.
        $form = $this->form->createBuilder()->getForm();
        $form->handleRequest($request);

        // Delete the production.
        if ($form->isSubmitted() && $form->isValid()) {
            $this->em->remove($production);
            $this->em->flush();

            // Set success message and redirect.
            $this->session->getFlashBag()->add(
                'success',
                $this->translator->trans('production.deleted', [
                    '%production%' => $production->getName(),
                ], BkstgCoreBundle::TRANSLATION_DOMAIN)
            );

            return new RedirectResponse($this->url_generator->generate('bkstg_production_admin_index'));
        }

        // Render the form.
        return new Response($this->templating->render('@BkstgCore/ProductionAdmin/delete.html.twig', [
            'production' => $production,
            'form' => $form->createView(),
        ]));
    }
1071163
public function deleteAction(Request $request, $id)
    {
        $this->checkIfUserHasPermission(Permission::CREATE_DELETE);

        $this->getParentEntityDefinition($request);

        $entity = $this->getEntity($id);

        $this->getEventDispatcher()->dispatch(
            Events::PRE_CRUD_CONTROLLER_ACTION,
            new CrudControllerActionEvent($this->meta, __FUNCTION__)
        );

        $form = $this->getAdminFormFactory()->createDeleteForm($entity, $this->entityClass)->handleRequest($request);

        if ($this->getFormHandler()->handleDeleteForm($form, $entity)) {
            $this->getEventDispatcher()->dispatch(CrudEvents::DELETED, new DeletedEvent($this->getUser(), $entity));

            return $this->redirect($this->getAdminRouter()->generate($entity, $this->entityClass, AdminRouter::TYPE_INDEX));
        }

        $url = $request->headers->get(
            'referer',
            $this->getAdminRouter()->generate($entity, $this->entityClass, AdminRouter::TYPE_INDEX)
        );

        return $this->redirect($url);
    }
525106
public function destroy($id)
    {
        try {
            $this->file->destroy($id);
        
            return response()->json([
                'status' => 'success'
            ]);
        } 

        catch (Exception $e) {
            return $this->handleError($e);
        }
    }
1268817
public function deleteAction(Request $request, $id)
    {
        $section = $this->getSection($id, true);

        $section->delete();

        $prefix = $request->query->get('prefix');

        $this->get('session')->getFlashBag()->add(
            'success',
            $this->get('translator')->trans(
                'section.delete.success',
                array(
                    '%section%' => $section->getTitle(),
                    '%prefix%' => $prefix ? $prefix . ' ' : ''
                ),
                'CPTermsBundle',
                $request->getLocale()
            )
        );

        return $this->redirect($this->generateUrl('cp_terms_admin_show', array('id' => $section->getTermsId())));
    }
1138972
public function deleteAction(Request $request, $id)
    {
        $acl = $this->get('bacon_acl.service.authorization');

        if (!$acl->authorize('users', 'DELETE')) {
            throw $this->createAccessDeniedException();
        }

        $className = $this->getParameter('fos_user.model.user.class');
        $entity = $this->getDoctrine()->getRepository($className)->find($id);

        $form = $this->createDeleteForm('admin_user_delete',$entity);

        $form->handleRequest($request);

        if ($form->isSubmitted() and $form->isValid()) {

            $this->getDoctrine()->getManager()->remove($entity);
            $this->getDoctrine()->getManager()->flush();

            $this->getFlashBag()->add('message', array(
                'type' => 'success',
                'message' => 'The record has been removed successfully',
            ));

            return new RedirectResponse($this->generateUrl('admin_user'));
        }
    }
754364
public function deleteAction($id, Request $request, $menuId = null)
    {
        $this->menuId = $menuId;

        return parent::deleteAction($id, $request);
    }
335804
public function destroy(Request $request, $id)
    {
        $this->validate($request, [
            'id' => 'uuid'
        ]);

        $did = Did::where(['id' => $id, 'user_id' => $request->user()->id])->firstOrFail();

        // Detach all tags from the did
        $did->tags()->detach();

        $did->delete();
    }
1065238
public function deleteAction($id, Request $request)
    {
        $data = $this->resolveData($id);
        $title = $this->resolveDataTitle($data);

        $breadcrumbs = $this->buildBreadcrumbs($this->getType());
        $breadcrumbs->addItem(sprintf('Delete "%s"', $this->resolveDataTitle($data)));

        $form = $this->createForm(DeleteFormType::class, array(
            'id' => $data->getId(),
            'title' => $title,
        ));

        $form->handleRequest($request);

        if ($form->isValid()) {
            if ($form->get('tabs')->get('actions')->get('delete')->isClicked()) {
                $manager = $this->getDoctrine()->getManager();
                $manager->remove($data);
                $manager->flush();

                $request->getSession()
                    ->getFlashBag()
                    ->add('success', sprintf('You deleted "%s"!', $title));
            }

            if ($request->query->has('_return')) {
                $redirectUrl = $this->generateUrl($request->query->get('_return'));
            } else {
                $redirectUrl = $this->getListUrl();
            }

            return $this->redirect($redirectUrl);
        }

        $module = $this->getModule($this->getType());

        return $this->render('ClasticNodeBundle:Backoffice/Node:form.html.twig', array(
            'page_title' => sprintf('Delete "%s"?', $title),
            'form' => $form->createView(),
            'module' => $module,
            'submodules' => $this->getSubmodules($module),
        ));
    }