The gazette has only one page, and Madame Lou would like each article to have its own, with its own address: /articles/the-pumpkin-festival. To match an address to some code, you need a router. You could write one yourself, but others have already done it very well: FastRoute, by Nikita Popov, one of the developers of PHP itself.
Your mission
- In the console, install FastRoute:
composer require nikic/fast-route. - Read what Composer prints: the version it chose,
composer.jsonupdated, the package placed invendor/, the autoloader regenerated. - Open
composer.json: the package has appeared underrequire, with its version constraint.
The front page doesn't change yet: the router takes the stage a little later in this chapter.
Reminder
composer require vendor/package adds a dependency to the project in a single command: the line in composer.json, the exact version in composer.lock, the code in vendor/, and the autoloading that goes with it. The constraint ^1.3 accepts version 1.3 and later, up to but not including 2.0: the versions that don't break anything. In this editor, Composer has no network access: it picks from a small catalog of packages prepared in advance.