public function prepend($segment)
    {
        $segments = is_array($segment) ? $segment : func_get_args();

        $newPath = $this->path->copy();

        foreach (array_reverse($segments) as $segment) {
            $newPath->prepend($segment);
        }

        return $this->replicate(['path' => $newPath]);
    }
public function prepend($segment)
    {
        $segments = is_array($segment) ? $segment : func_get_args();

        $newPath = $this->path->copy();

        foreach (array_reverse($segments) as $segment) {
            $newPath->prepend($segment);
        }

        return $this->replicate(['path' => $newPath]);
    }
public function prepend ( $ segment ) { $ segments = is_array ( $ segment ) ? $ segment : func_get_args ( ) ; $ newPath = $ this -> path -> copy ( ) ; foreach ( array_reverse ( $ segments ) as $ segment ) { $ newPath -> prepend ( $ segment ) ; } return $ this -> replicate ( [ 'path' => $ newPath ] ) ; }
Prepend a segment to the path.

@param string|array $segment

@return self
Prepend a segment to the path .