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

fbc's avatar
Level 2

make:auth causes 'Unable to prepare route [api/user] for serialization. Uses Closure.'

I when I use make:auth in Laravel 5.3 and try to run 'php artisan route:cache' I get this error: [LogicException] Unable to prepare route [api/user] for serialization. Uses Closure.

Did I do something wrong?

Also 'php artisan route:list' is failing to show all my routes. I'm pretty sure the first problem is causing the later.

0 likes
2 replies
jekinney's avatar
jekinney
Best Answer
Level 47

First issue is in your routes/API file. If you're not using the user route remove it. Secondly If route list doesn't show an error, it should be fine. If your routes don't show your routes you don't have them set up right.

2 likes
fbc's avatar
Level 2

Thanks, that appears to have worked and it did not affect my login or registration at all.

Please or to participate in this conversation.