Laravel\Lumen\Concerns\RoutesRequests::dispatch PHP Method

dispatch() public method

Dispatch the incoming request.
public dispatch ( Request | null $request = null ) : Illuminate\Http\Response
$request Symfony\Component\HttpFoundation\Request | null
return Illuminate\Http\Response
    public function dispatch($request = null)
    {
        list($method, $pathInfo) = $this->parseIncomingRequest($request);
        try {
            return $this->sendThroughPipeline($this->middleware, function () use($method, $pathInfo) {
                if (isset($this->routes[$method . $pathInfo])) {
                    return $this->handleFoundRoute([true, $this->routes[$method . $pathInfo]['action'], []]);
                }
                return $this->handleDispatcherResponse($this->createDispatcher()->dispatch($method, $pathInfo));
            });
        } catch (Exception $e) {
            return $this->sendExceptionToHandler($e);
        } catch (Throwable $e) {
            return $this->sendExceptionToHandler($e);
        }
    }