webmozart/path-util
Lightweight PHP utility for safe, cross-platform path handling. Normalize, join, resolve and compare filesystem paths, with helpers for absolute/relative paths and canonicalization. Useful for file operations and libraries needing consistent path logic.
Url::makeRelative() for calculating relative paths between URLsPath::makeRelative() to trim leading dots when moving outside of
the base pathPath::makeRelative() to produce .. when called with the parent
directory of a pathPath::makeAbsolute() does not fail anymore if an absolute path is passed
with a different root (partition) than the base pathPath::normalize()Path::canonicalize() now turns ~ into the user's home directory on
Unix and Windows 8 or later.Path::join()Path methods now throw exceptions if parameters with invalid types are
passedPath::canonicalize() in order to increase the
performance of the Path classPath::getFilename()Path::getFilenameWithoutExtension()Path::getExtension()Path::hasExtension()Path::changeExtension()Path::makeRelative() now works when the absolute path and the base path
have equal directory names beneath different base directories
(e.g. "/webmozart/css/style.css" relative to "/puli/css")Path::makeAbsolute() fails now if the base path is not absolutePath::makeRelative() now works when a relative path is passed and the base
path is emptyPath::makeRelative() when first argument is shorter than secondHow can I help you explore Laravel packages today?