Illuminate\Routing\Router::prefix PHP Method

prefix() protected method

Prefix the given URI with the last prefix.
protected prefix ( string $uri ) : string
$uri string
return string
    protected function prefix($uri)
    {
        return trim(trim($this->getLastGroupPrefix(), '/') . '/' . trim($uri, '/'), '/') ?: '/';
    }

Usage Example

Example #1
0
 /**
  * Prefix the given URI with the last prefix.
  *
  * @param  string $uri
  *
  * @return string
  */
 protected function prefix($uri)
 {
     if ($uri == $this->formatSuffix) {
         return trim(trim($this->getLastGroupPrefix(), '/') . trim($uri, '/'), '/') ?: '/';
     }
     return parent::prefix($uri);
 }