private function stripRouteFromPath(Http\Request $request, $route)
    {
        $this->removed = $route;

        $uri  = $request->getUri();
        $path = $this->getTruncatedPath($route, $uri->getPath());
        $new  = $uri->withPath($path);

        // Root path of route is treated differently
        if ($path === '/' && '/' === substr($uri->getPath(), -1)) {
            $this->removed .= '/';
        }

        return $request->withUri($new);
    }
private function stripRouteFromPath(Http\Request $request, $route)
    {
        $this->removed = $route;

        $uri  = $request->getUri();
        $path = $this->getTruncatedPath($route, $uri->getPath());
        $new  = $uri->withPath($path);

        // Root path of route is treated differently
        if ($path === '/' && '/' === substr($uri->getPath(), -1)) {
            $this->removed .= '/';
        }

        return $request->withUri($new);
    }
private function stripRouteFromPath ( Http \ Request $ request , $ route ) { $ this -> removed = $ route ; $ uri = $ request -> getUri ( ) ; $ path = $ this -> getTruncatedPath ( $ route , $ uri -> getPath ( ) ) ; $ new = $ uri -> withPath ( $ path ) ; // Root path of route is treated differently if ( $ path === '/' && '/' === substr ( $ uri -> getPath ( ) , - 1 ) ) { $ this -> removed .= '/' ; } return $ request -> withUri ( $ new ) ; }
Strip the route from the request path

@param Http\Request $request
@param string $route
@return Http\Request
Strip the route from the request path