protected function validateRouteUrl(string $path): string
    {
        // If the last character is not a slash and the config is set to
        // ensure trailing slash
        if (
            $path[-1] !== '/'
            && $this->app->config()['routing']['trailingSlash']
        ) {
            // add a trailing slash
            $path .= '/';
        }

        return $path;
    }
protected function validateRouteUrl(string $path): string
    {
        // If the last character is not a slash and the config is set to
        // ensure trailing slash
        if (
            $path[-1] !== '/'
            && $this->app->config()['routing']['trailingSlash']
        ) {
            // add a trailing slash
            $path .= '/';
        }

        return $path;
    }
protected function validateRouteUrl ( string $ path ) : string { // If the last character is not a slash and the config is set to // ensure trailing slash if ( $ path [ - 1 ] !== '/' && $ this -> app -> config ( ) [ 'routing' ] [ 'trailingSlash' ] ) { // add a trailing slash $ path .= '/' ; } return $ path ; }
Validate the route url.

@param string $path The path

@return string
Validate the route url .