Deletes the resource object or a list of resource objects

@param \Psr\Http\Message\ServerRequestInterface $request Request object
@return \Psr\Http\Message\ResponseInterface Response object containing the generated output
342235
public function deleteAction( ServerRequestInterface $request )
	{
		if( config( 'shop.authorize', true ) ) {
			$this->authorize( 'admin', [JsonadmController::class, ['admin', 'api']] );
		}

		return $this->createAdmin()->delete( $request, new Response() );
	}
1229268
public function delete(Request $request)
    {
        // AUTHORIZE ... COMES HERE
        $status = $this->pageBlockRepository->deleteById($request->get('pageblock_id'));
        return $status;
    }
203991
public function deleteAction(Request $request)
    {
        $fileId = $request->get('file_id');
        $fileIds = explode(',', $fileId);

        $volumeManager = $this->get('phlexible_media_manager.volume_manager');

        foreach ($fileIds as $fileId) {
            try {
                $volume = $volumeManager->getByFileId($fileId);
                $file = $volume->findFile($fileId);
                $volume->deleteFile($file, $this->getUser()->getId());
            } catch (NotFoundException $e) {
            }
        }

        return new ResultResponse(true, count($fileIds).' file(s) deleted.');
    }
914694
public function delete(Request $request)
    {
        $disk = Storage::disk($request->get('disk'));
        $file = $request->get('file');

        if ($disk->exists($file)) {
            $disk->delete($file);

            return response()->json([
                'status'  => true,
                'message' => trans('admin.delete_succeeded'),
            ]);
        }

        return response()->json([
            'status'  => false,
            'message' => trans('admin.delete_failed'),
        ]);
    }
845434
public function handle(ServerRequestInterface $request): ResponseInterface
    {
        return $this->dispatchRoute($this->resolve($request), $request);
    }
342437
public function dispatch(ServerRequestInterface $request): ResponseInterface
    {
        return $this->get($request)->process($request, $this);
    }
37292
public function remove(Request $request)
    {
        $type = $request->get('type');

        return $this->manager()->{$type}()->remove($request->all());
    }
132083
public function handleRequest(ServerRequestInterface $request) : ResponseInterface
    {
        list($callback, $params) = $this->internalRequestHandle($request);

        return call_user_func($callback, $params);
    }
719944
public function handle(ServerRequestInterface $request): ResponseInterface
    {
        if (empty($this->requestHandler)) {
            $this->requestHandler = $this->requestHandler();
        }

        return $this->pipeline->process(
            $request->withAttribute(self::ROUTE_ATTRIBUTE, $this),
            $this->requestHandler
        );
    }
205842
public function dispatch(ServerRequestInterface $request): ResponseInterface
    {
        reset($this->middleware);

        return $this->handle($request);
    }
330094
public function delete( ServerRequestInterface $request, ResponseInterface $response )
	{
		return $this->client->delete( $request, $response );
	}
31633
public function delete( ServerRequestInterface $request, ResponseInterface $response )
	{
		$view = $this->getView();

		try
		{
			$response = $this->deleteItems( $view, $request, $response );
			$status = 200;
		}
		catch( \Aimeos\Admin\JsonAdm\Exception $e )
		{
			$status = $e->getCode();
			$view->errors = array( array(
				'title' => $this->getContext()->getI18n()->dt( 'admin/jsonadm', $e->getMessage() ),
				'detail' => $e->getTraceAsString(),
			) );
		}
		catch( \Aimeos\MShop\Exception $e )
		{
			$status = 404;
			$view->errors = array( array(
				'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ),
				'detail' => $e->getTraceAsString(),
			) );
		}
		catch( \Exception $e )
		{
			$status = 500;
			$view->errors = array( array(
				'title' => $e->getMessage(),
				'detail' => $e->getTraceAsString(),
			) );
		}

		/** admin/jsonadm/standard/template-delete
		 * Relative path to the JSON API template for DELETE requests
		 *
		 * The template file contains the code and processing instructions
		 * to generate the result shown in the JSON API body. The
		 * configuration string is the path to the template file relative
		 * to the templates directory (usually in admin/jsonadm/templates).
		 *
		 * You can overwrite the template file configuration in extensions and
		 * provide alternative templates. These alternative templates should be
		 * named like the default one but with the string "standard" replaced by
		 * an unique name. You may use the name of your project for this. If
		 * you've implemented an alternative client class as well, "standard"
		 * should be replaced by the name of the new class.
		 *
		 * @param string Relative path to the template creating the body for the DELETE method of the JSON API
		 * @since 2015.12
		 * @category Developer
		 * @see admin/jsonadm/standard/template-aggregate
		 * @see admin/jsonadm/standard/template-get
		 * @see admin/jsonadm/standard/template-patch
		 * @see admin/jsonadm/standard/template-post
		 * @see admin/jsonadm/standard/template-put
		 * @see admin/jsonadm/standard/template-options
		 */
		$tplconf = 'admin/jsonadm/standard/template-delete';
		$default = 'delete-standard';

		$body = $view->render( $view->config( $tplconf, $default ) );

		return $response->withHeader( 'Content-Type', 'application/vnd.api+json; supported-ext="bulk"' )
			->withBody( $view->response()->createStreamFromString( $body ) )
			->withStatus( $status );
	}
636336
public function cleanup(ServerRequestInterface $request): ResponseInterface
    {
        $months = (int) ($request->getQueryParams()['months'] ?? 6);

        $inactive_threshold   = time() - $months * 30 * self::SECONDS_PER_DAY;
        $unverified_threshold = time() - 7 * self::SECONDS_PER_DAY;

        $users = $this->user_service->all();

        $inactive_users = $users->filter(static function (UserInterface $user) use ($inactive_threshold): bool {
            if ($user->getPreference('sessiontime') === '0') {
                $datelogin = (int) $user->getPreference('reg_timestamp');
            } else {
                $datelogin = (int) $user->getPreference('sessiontime');
            }

            return $datelogin < $inactive_threshold && $user->getPreference('verified');
        });

        $unverified_users = $users->filter(static function (UserInterface $user) use ($unverified_threshold): bool {
            if ($user->getPreference('sessiontime') === '0') {
                $datelogin = (int) $user->getPreference('reg_timestamp');
            } else {
                $datelogin = (int) $user->getPreference('sessiontime');
            }

            return $datelogin < $unverified_threshold && !$user->getPreference('verified');
        });

        $options = $this->monthOptions();

        $title = I18N::translate('Delete inactive users');

        return $this->viewResponse('admin/users-cleanup', [
            'months'           => $months,
            'options'          => $options,
            'title'            => $title,
            'inactive_users'   => $inactive_users,
            'unverified_users' => $unverified_users,
        ]);
    }
818685
public function destroy(Request $request)
    {
        $this->validate($request, ['action' => 'in:delete,permadelete']);

        $permanent = !config('forum.preferences.soft_deletes') || ($request->input('action') == 'permadelete');

        $parameters = $request->all();
        $parameters['force'] = $permanent ? 1 : 0;

        $thread = $this->api('thread.delete', $request->route('thread'))->parameters($parameters)->delete();

        Forum::alert('success', 'threads.deleted', 1);

        return redirect($permanent ? Forum::route('category.show', $thread->category) : Forum::route('thread.show', $thread));
    }
807183
public function handle(ServerRequestInterface $request): ResponseInterface
    {
        $details = new Inspector($this->e);

        $contents = json_encode([
            'type' => get_class($details->inner()),
            'message' => $details->inner()->getMessage(),
            'context' => [
                'type' => get_class($details->current()),
                'message' => $details->current()->getMessage(),
            ],
            'trace' => $details->inner()->getTrace(),
        ]);

        $response = $this->factory
            ->createResponse(500)
            ->withHeader('Content-type', 'application/json');

        $response->getBody()->write($contents);

        return $response;
    }
1216354
public function delete(Request $request)
    {
        $json = [];

        if ($request->get('directory')) {
            $this->storage->deleteDirectory($request->get('directory'));
            Image::deleteDirectory($this->path . $request->get('directory'));
            $json['success'] = trans('admin::image.success.delete');
        } elseif ($request->get('file')) {
            $this->storage->delete($request->get('file'));
            Image::delete($this->path . $request->get('file'));
            $json['success'] = trans('admin::image.success.delete');
        } else {
            $json['error'] = trans('admin::image.error.delete');
        }

        return response()
            ->json($json);
    }
1048340
public function deleteAction(Request $request)
    {
        if (!$request->isXmlHttpRequest()) {
            throw new NotFoundHttpException();
        }

        $folder = $this->findFolderById($request->attributes->get('id'));

        $result = array();
        try {
            $this->removeFolder($folder);
        } catch (DBALException $e) {
            $result = array(
                'error'   => true,
                'message' => 'Ce dossier n\'est pas vide.',
            );
        }

        $response = new Response(json_encode($result, JSON_FORCE_OBJECT));
        $response->headers->add(array('Content-Type' => 'application/json'));
        return $response;
    }