Level 50
In Laravel 8 and above, route:cache also works with Closure. Update to these newer versions of Laravel to utilize the feature.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
As you might be aware, the artisan route:cache command throws a LogicException when there are any routes that use a Closure. I need these routes, but would still like to be able to cache my other conventional routes. Is it possible to exclude certain routes from caching?
Please or to participate in this conversation.