Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

siiamine's avatar

logicexception

please what is the solution for this

logicexception: Unable to prepare route [api/user] for serialization. Uses Closure.

0 likes
1 reply
aurawindsurfing's avatar

Hi,

Is that when you try to cache the routes?

I think you can not have any closures in a cached routes file. They need to be in your controllers.

Hope it helps!

Please or to participate in this conversation.