Handle the given request. Remember that Slack expects a response
within three seconds after the slash command was issued. If
there is more time needed, dispatch a job.

@param \Spatie\SlashCommand\Request $request

@return \Spatie\SlashCommand\Response
161663
public function handle(Request $request): Response
    {
        $response = $this->respondToSlack("I did not recognize this command: `/{$request->command} {$request->text}`");

        list($command) = explode(' ', $this->request->text);

        $alternativeHandlers = $this->findAlternativeHandlers($command);

        if ($alternativeHandlers->count()) {
            $response->withAttachment($this->getCommandListAttachment($alternativeHandlers));
        }

        if ($this->containsHelpHandler($alternativeHandlers)) {
            $response->withAttachment(Attachment::create()
                ->setText("For all available commands, try `/{$request->command} help`")
            );
        }

        return $response;
    }
812287
public function dispatch(Request $request)
    {
        $url = $request->getQueryString();
        $url = $this->RemoveQueryString($url, new Request());
        if ($this->match($url)) {
            (isset($this->params['middleware'])) ? $this->params['middleware'] = new $this->params['middleware']() : null;
            if (!isset($this->params['callable'])) {
                $controller = $this->params['controller'];
                $controller = $this->convertToStudlyCaps($controller);
                $controller = $this->getNamespace().$controller;
                if (class_exists($controller)) {
                    (isset($this->params['middleware']) && is_object($this->params['middleware'])) ? ( new $this->params['middleware']())->before(new Request(), new Response(), $this->params) : null;
                    $controller_object = new $controller($this->params, $this->getInput(new Input()));
                    $action = $this->params['action'];
                    $action = $this->convertToCamelCase($action);
                    if (preg_match('/action$/i', $action) == 0) {
                        $controller_object->$action();
                        (isset($this->params['middleware']) && is_object($this->params['middleware'])) ? (new $this->params['middleware']())->after(new Request(), new Response(), $this->params) : null;
                    } else {
                        throw new \Exception("Method $action in controller $controller cannot be called directly - remove the Action suffix to call this method");
                    }
                } else {
                    throw new \Exception("Controller class $controller not found");
                }
            } else {
                (is_object(isset($this->params['middleware']))) ? $this->params['middleware']->before(new Request(), new Response(), $this->params) : null;
                call_user_func($this->params['callable'], $this->params);
                (is_object(isset($this->params['middleware']))) ? $this->params['middleware']->after(new Request(), new Response(), $this->params) : null;
            }
        } else {
            \Zest\Component\Router::loadComponents();
        }
    }
578478
public function execute (Request $request)
		{
			$parsed = $this->parseRouteRequest($request);

			$controller = $this->getController($request);

			return $controller->dispatch(
				$parsed['method'],
				$parsed['arguments']
			);
		}
431233
private function dispatchRequest($request)
    {
        // track the number of requests across instances
        self::$requestCount++;
        $timestart = microtime(true);

        $response = self::transport()->send($request);

        // pass the response through the filter chain
        foreach ($this->filters as $filter) {
            $response = $filter->response($response);
        }

        $httpCode = $response->getStatus()->getCode();
        $location = $response->getHeaders()->value('Location');
        $body = $response->getBody();

        // track the time taken across instances
        self::$requestTime += microtime(true) - $timestart;

        // process a redirect if needed
        if ($httpCode < 400 && $location) {
            return $this->redirect($location);
        } else {
            $this->redirects = 0;
        }

        // translate error code to a typed exception
        if ($httpCode == 500) {
            throw new Error\InternalServerError($body);
        } elseif ($httpCode == 400) {
            throw new Error\BadRequest($body);
        } elseif ($httpCode == 401) {
            throw new Error\Unauthorized($body);
        } elseif ($httpCode == 404) {
            throw new Error\NotFound($body);
        } elseif ($httpCode >= 300) {
            throw new Error($body, $httpCode);
        }

        return $response;
    }
476334
private function handle(Request $request)
    {
        $kernel = $this->kernelFactory->create($this->environment);

        try {
            return $kernel->handle($request, HttpKernelInterface::MASTER_REQUEST, false);
        } catch (HttpException $e) {
            if ($e->getPrevious()) {
                throw $e->getPrevious();
            }

            throw $e;
        }
    }
249953
private function handle(Request $request) : Response
    {
        $router = $this->getInstance(Router::class);

        if ($router->match($request->getPathInfo(), $request->getMethod())) { // A match has been found
            /** @var Route $match */
            $match = $router->getMatch();

            // Check if the handler is a closure or not
            $handler = $match->getHandler();

            if (is_object($handler) && $handler instanceof \Closure) {
                try {
                    $content = $this->resolveClosure($handler);
                } catch (\Exception $e) {
                    if (DEVELOPMENT) {
                        showPlainError('Something went wrong while resolving a closure, details below:', false);
                        pr($e);
                        exit;
                    }

                    return $this->respond(500);
                }
            } else {
                $controller = substr($handler, 0, stripos($handler, '.'));
                $method = substr($handler, (stripos($handler, '.') + 1));

                try {
                    $instance = $this->getInstance($controller);
                    if (method_exists($instance, 'setCrispySystem')) {
                        $instance->setCrispySystem($this);
                    }
                    $content = $this->resolveMethod($instance, $method, $match->getParameters());
                } catch (\Exception $e) {
                    if (DEVELOPMENT) {
                        showPlainError('Something went wrong while resolving a controller, details below:', false);
                        pr($e);
                        exit;
                    }

                    return $this->respond(500);
                }
            }

            return $this->respond(200, $content);
        }

        // No match found
        return $this->respond(404);
    }
110595
public function handle(Request $request)
	{
		$response = $this->next($request);

		$arguments = $this->app['arguments'];
		$output    = $this->app['output'];

		// Check for interactivity flag and set on output accordingly
		if ($arguments->getOpt('non-interactive'))
		{
			$output->makeNonInteractive();
		}

		// Check for color flag and set on output accordingly
		if ($arguments->getOpt('no-colors'))
		{
			$output->makeUnColored();
		}

		// If task is help, set the output to our output class with extra methods for rendering help doc
		if ($arguments->get('task') == 'help')
		{
			$output = $output->getHelpOutput();
		}

		// If the format opt is present, try to use the appropriate output subclass
		if ($arguments->getOpt('format'))
		{
			$output = $output->getOutputFormatter($arguments->getOpt('format'));
		}

		// Register any user specific events
		if ($hooks = Config::get('hooks'))
		{
			foreach ($hooks as $trigger => $scripts)
			{
				foreach ($scripts as $script)
				{
					Event::register($trigger, function() use ($script, $output)
					{
						if ($output->getMode() != 'minimal')
						{
							$output->addLine("Running '{$script}'");
						}
						shell_exec(escapeshellcmd($script));
					});
				}
			}
		}

		// Reset the output stored on the application
		$this->app->forget('output');
		$this->app->set('output', $output);

		return $response;
	}
960992
public function handle(Request $request)
    {
        $this->currentUri = $request->fullUrl();

        $this->response = $this->app->prepareResponse($this->app->handle($request));

        return $this;
    }
600130
private function post($request)
    {
        try {
            $responseGuzzle = $this->client->request('post', $this->url, $request->build());
        } catch (ClientException $e) {
            $responseGuzzle = $e->getResponse();
        }

        return $responseGuzzle;
    }
257222
private function callLaravelRoute(Request $request): \Symfony\Component\HttpFoundation\Response
    {
        $kernel = app(\Illuminate\Contracts\Http\Kernel::class);
        $response = $kernel->handle($request);
        $kernel->terminate($request, $response);

        return $response;
    }
1134705
public function handle(Request $request)
	{
		$response = $this->next($request);

		// If CLI then we have to gather all query, post and header values
		// into params for Oauth_Provider's constructor.
		$params = array();

		if ($this->app->runningInConsole())
		{
			$queryvars = $this->app['request']->get('queryvars');
			$postvars  = $this->app['request']->get('postdata');

			if (!empty($queryvars))
			{
				foreach ($queryvars as $key => $value)
				{
					if (isset($queryvars[$key]))
					{
						$params[$key] = $queryvars[$key];
					}
					else if (isset($postvars[$key]))
					{
						$params[$key] = $postvars[$key];
					}
				}
			}

			if (!empty($postvars))
			{
				foreach ($postvars as $key => $value)
				{
					if (isset($queryvars[$key]))
					{
						$params[$key] = $queryvars[$key];
					}
					else if (isset($postvars[$key]))
					{
						$params[$key] = $postvars[$key];
					}
				}
			}

			if (empty($params))
			{
				return false;
			}
		}

		$this->app['authn'] = $this->app['auth']->authenticate($params);

		$this->app['request']->setVar('validApiKey', !empty($this->app['authn']['consumer_key']));

		return $response;
	}
430583
public function handle($request)
    {
        $entity = $this->repository()->findById($request->getId());
        $this->authorize($request, $entity);

        $item = $this->getProperty($entity, $this->field());
        $this->related()->getEntityManager()->remove($item);
        $this->setProperty($entity, $this->field(), null);

        $this->repository()->getEntityManager()->flush();

        return $this->response()->noContent();
    }
887516
public function dispatch(SymfonyRequest $request)
    {
        $path = rawurldecode($request->getPathInfo());

        if (substr($path, 0, 3) == '../' || substr($path, -3) == '/..' || strpos($path, '/../') ||
            substr($path, 0, 3) == '..\\' || substr($path, -3) == '\\..' || strpos($path, '\\..\\')) {
            throw new \RuntimeException(t('Invalid path traversal. Please make this request with a valid HTTP client.'));
        }

        $response = null;
        if ($this->app->isInstalled()) {
            $response = $this->getEarlyDispatchResponse();
        }
        if ($response === null) {
            $response = $this->handleDispatch($request);
        }

        return $response;
    }
214392
public function handle(Request $request)
    {
        $response = new Response();
        $response = $this->executePassiveActions($request, $response);
        $response = $this->executeAction($request, $response);

        if ($response->isClientError() || $response->isServerError()) {
            return $this->handleError($request, $response);
        }

        return $response;
    }
493942
public function dispatch($request = null)
    {
        $this->boot();

        list($method, $pathInfo) = $this->parseIncomingRequest($request);

        try {
            return $this->sendThroughPipeline($this->middleware, function () use ($method, $pathInfo) {
                if (isset($this->router->getRoutes()[$method.$pathInfo])) {
                    return $this->handleFoundRoute([true, $this->router->getRoutes()[$method.$pathInfo]['action'], []]);
                }

                return $this->handleDispatcherResponse(
                    $this->createDispatcher()->dispatch($method, $pathInfo)
                );
            });
        } catch (Throwable $e) {
            return $this->prepareResponse($this->sendExceptionToHandler($e));
        }
    }
1241426
public function handle(Request $request)
	{
		// execute response
		$response = $this->next($request);

		// check for presence of callback param
		// if we have one lets replace response content with a function executing the 
		// current response content
		if ($callback = $request->getVar('callback', null))
		{
			$response->headers->set('content-type', 'application/javascript');
			$response->setContent(sprintf('%s(%s);', $callback, $response->getContent()));
		}

		// return response
		return $response;
	}
424130
public function handleRequest($request)
    {
        list ($route, $params) = $request->resolve();
        $this->requestedRoute = $route;
        $result = $this->runAction($route, $params);
        if ($result instanceof Response) {
            return $result;
        } else {
            $response = $this->getResponse();
            $response->exitStatus = $result;

            return $response;
        }
    }