You can use first class callables for routes in PHP 8.1

You can use first class callables for routes in PHP 8.1

🔥 You can use first class callables for routes in PHP 8.1

The caveat is that the methods need to be static because there's no syntax for referencing instance methods on classes

I don't use constructor DI in my apps, so static methods are fine despite feeling a bit non-standard

We're writing a book, you can get it for free here.