Skip to content

Releases: thephpleague/route

6.1.0

20 Nov 10:03
Compare
Choose a tag to compare

[6.1.0] 2024-11

Fixed

  • Fixed a bug introduced in 6.0.0 where an array based callable with a string class name would not be considered valid.
  • Added some doc comments for clarity on array types. (@marekskopal)

Changed

  • Updated psr/http-message to ^2.0.0.

6.0.0

10 Nov 12:09
Compare
Choose a tag to compare

[6.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 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.

Added

  • Added full support for PHP 8.1 to 8.4.
  • Ability to use a PSR-15 middleware as a controller.
  • Ability to pass an array of HTTP methods to Router::map to create a route that matches multiple methods.
    • This method still accepts a string so is not a breaking change.
  • Ability to add a custom key to a caching router.

Changed

  • Fixes and improvements throughout for PHP 8.1 to 8.4.

Removed

  • Removed support for PHP < 8.1.

5.1.2

30 Jul 08:34
Compare
Choose a tag to compare

Added

  • Extra logic for Route::gretPath to be able to properly resolve optional parameters.

5.1.1

26 Jul 06:48
Compare
Choose a tag to compare

Fix

  • Fix to allow multiple routes with the same path to be mapped across multiple extra conditions (scheme, host, port).

5.1.0

09 Jul 09:37
Compare
Choose a tag to compare

Added

  • Support for named routes within groups (@Fredrik82)

5.0.1

26 Mar 11:28
Compare
Choose a tag to compare

Added

  • Support for psr/container:2.0

5.0.0

25 Jan 13:58
Compare
Choose a tag to compare

[5.0.0] 2021-01

Added

  • A cached router, a way to have a fully built router cached and resolved from cache on subsequent requests.
  • Response decorators, a way to manipulate a response object returned from a matched route.
  • Automatic generation of OPTIONS routes if they have not been defined.

Changed

  • Minimum PHP requirement bumped to 7.2.
  • Router no longer extends FastRoute RouteCollecter.
    • Router constructor no longer accepts optional FastRoute RouteParser and DataGenerator.
    • Router constructor now accepts an optional FastRoute RouteCollector.
      • Routes already registered with FastRoute RouteCollector are respected and matched.
  • Separated route preparation from dispatch process so that the router can dispatch multiple times.
  • General code improvements.

Removed

  • Setting of default response headers on strategies. (Replaced by response decorators, see Added).
  • Exception handlers from strategies. (Already deprecated in favour of throwable handlers).

4.5.0

25 Jun 12:17
Compare
Choose a tag to compare

[4.5.0] 2020-05

Added

  • Ability to pass optional $replacements array to Route::getPath in order to build literal route path strings.

4.4.0

18 May 07:14
Compare
Choose a tag to compare

[4.4.0] 2020-05

Added

  • Ability to pass JSON flags to JsonStrategy. (@pine3ree)
  • Router is now a RequestHandlerInterface so can be used as a middleware itself. (@delboy1978uk)
  • Route params now added as Request attributes. (@delboy1978uk)

Fixed

  • Exception moved to more appropriate place when shifting no middleware. (@delboy1978uk)
  • Ensure group prefix is always added when adding a parent group. (@delboy1978uk)

4.3.1

01 Jul 19:37
Compare
Choose a tag to compare

[4.3.1] 2019-07

Fixed

  • Fixed bug when attempting to get a container for custom strategy that is not container aware.