NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist · #3178 most downloaded on Packagist
Fast routing and dispatch component including PSR-15 middleware, built on top of FastRoute.
Last release 2 months ago
14 Jul 2026
Ships unpredictably
gaps range from 9 days to 3.2 years
Most releases are documented
notes for 28 of 39 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
39 releases · first in 2015
RouterInterface extending PSR-15 RequestHandlerInterface for Router/Cache\Router substitutability.
RouterInterface extending PSR-15 RequestHandlerInterface for Router/Cache\Router substitutability.MatchResult value object and MatchStatus enum for matching routes without dispatching (#328, #352).Router::match() method to inspect route matching without executing handlers.Router::getRoutes() method to introspect all registered routes (#330).Route::setPathVars() for dispatcher-set path parameters, separate from user-set defaults.UrlGeneratorInterface with generateUrl() for reverse routing from named routes (#355).Router and Cache\Router both implement UrlGeneratorInterface.DispatcherInterface (marked @internal) formalising the Router-Dispatcher contract (#359).defineMiddlewareGroup() and middlewareGroup() for named middleware collections on Router and RouteGroup.MatchStatus::ConditionNotMet enum case distinguishing host/scheme/port condition failures from true not-found results.MatchResult::conditionNotMet() named constructor and isConditionNotMet() convenience method.MethodNotAllowedException::getAllowedMethods() for typed array access to allowed HTTP methods.Route object added as a request attribute (keyed by Route::class) during dispatch, enabling routing-aware middleware.prepareRoutes(), preventing silent post-compilation misconfiguration.FreezeableInterface, FreezeableTrait, and FreezeGuard for route immutability lifecycle.generateUrl(): routes using FastRoute [/{param}] syntax resolve correctly with defaults from setVars() or omit the segment when unset.query() route helper on Router and RouteGroup (via RouteCollectionInterface) for the HTTP QUERY method (draft-ietf-httpbis-safe-method-w-body).League\Route\ to League\Route\Test\.Route::setVars() now sets declaration-time defaults only; dispatcher uses setPathVars() internally (#350).Route::getVars() returns merged result of default vars and path vars, with path vars taking precedence.Cache\Router now implements RouterInterface.FileCache::getMultiple(), setMultiple(), and deleteMultiple() now throw BadMethodCallException instead of returning incorrect values.Dispatcher now uses composition instead of inheriting from FastRoute\Dispatcher\GroupCountBased (#359).Dispatcher constructor accepts strategy and route map at construction time instead of via setters.Dispatcher no longer implements RouteConditionHandlerInterface (condition matching extracted as internal concern).JsonStrategy::getOptionsCallable() returned closure now accepts (ServerRequestInterface $request, array $vars) parameters, enabling CORS-aware OPTIONS handling (#361).OptionsHandlerInterface::getOptionsCallable() docblock now specifies the expected callable signature.Dispatcher switch statements replaced with match expressions for exhaustiveness checking.MatchResult is now a readonly class.Route::setPathVars() marked @internal (dispatcher-only operation, exempted from route freezing).laravel/serializable-closure removed from hard dependencies (moved to suggest).Route constructor.prepareRoutes().Dispatcher::setRouteMap() removed (route map now set via constructor).Router::processGroups() method removed (consolidated into collectGroupRoutes()).One column per quarter.
Replaced opis/closure with laravel/serializable-closure and implemented throughout the handler process rather than a blanket serialisation of the rout
Further fixes for type hinting bug related to array based callables with a string class name.
Fixed a bug introduced in 6.0.0 where an array based callable with a string class name would not be considered valid.
psr/http-message to ^2.0.0.Note: While this is a major release, there are no breaking changes to the public API. The major version bump is due to the removal of support for PHP…
Note: While this is a major release, there are no breaking changes to the public API. The major version bump is due to the removal of support for PHP 8.0 and below.
This being said, there are some internal changes that may affect you if you have extended the library in any way. Please test thoroughly before upgrading.
Router::map to create a route that matches multiple methods.
Extra logic for Route::gretPath to be able to properly resolve optional parameters.
Route::gretPath to be able to properly resolve optional parameters.Fix to allow multiple routes with the same path to be mapped across multiple extra conditions (scheme, host, port).
Support for named routes within groups (@Fredrik82)
### Added - Support for psr/container:2.0
psr/container:2.0Exception handlers from strategies. (Already deprecated in favour of throwable handlers).
Router no longer extends FastRoute RouteCollecter.
Router constructor no longer accepts optional FastRoute RouteParser and DataGenerator.Router constructor now accepts an optional FastRoute RouteCollector.
RouteCollector are respected and matched.Nothing published for this version
Nothing published for this version
Nothing published for this version
### Added - Official support for PHP 8.0.
Ability to pass optional $replacements array to Route::getPath in order to build literal route path strings.
$replacements array to Route::getPath in order to build literal route path strings.Ability to pass JSON flags to JsonStrategy. (@pine3ree)
Fixed bug when attempting to get a container for custom strategy that is not container aware.
Ability to add middleware to the stack as a class name so it is only instantiated when used.
zendframework/zend-httphandlerrunner as removed from diactoros (@JohnstonCode)Allow adding default response headers to strategies.
Fixed issue where group middleware was being dublicated on internal routes.
JSON strategy now allows array and object returns and builds JSON response. (Thanks @willemwollebrants)
Fixed a bug where content-type header would not be added to response in Json Strategy.
Increased minimum PHP version to 7.1.0
Ensure JsonStrategy handles all exceptions by default.
### Fixed - Middleware execution order.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Have JsonStrategy handle all exceptions by default.
Nothing published for this version
All routing and dispatching now built around PSR-7.
Route object that describes the route.dispatch method on RouteCollection that is a compliant PSR-7 middleware.Nothing published for this version
Nothing published for this version
Nothing published for this version
Can now use any callable as a controller.
MethodArgumentStrategy.Added addPatternMatcher method to allow custom regex shortcuts within wildcard routes.
addPatternMatcher method to allow custom regex shortcuts within wildcard routes.Added import statements for all used objects.
### Added - Migrated from Orno\Route.
Your coding agent can read these notes before it upgrades. Set up the MCP server →