It seems that you can't have use route cache if you have route closures ... that is because reducing the performance
https://github.com/laravel/framework/issues/7319#issuecomment-73362932
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
When I use 'php artisan route:cache', it returns an error:
Route cache cleared!
[LogicException]
Unable to prepare route [api/user] for serialization. Uses Closure.
Please or to participate in this conversation.