laravel Unable to prepare route … for serialization. Uses Closure

前端 未结 8 1847
心在旅途
心在旅途 2020-11-30 04:48

When I clear caches in my Laravel 5.2 project, I see this error message:

[LogicException] Unable to prepare route [panel] for serialization. Uses Closure.

8条回答
  •  误落风尘
    2020-11-30 05:16

    If none of your routes contain closures, but you are still getting this error, please check

    routes/api.php

    Laravel has a default auth api route in the above file.

    Route::middleware('auth:api')->get('/user', function (Request $request) {
        return $request->user();
    });
    

    which can be commented or replaced with a call to controller method if required.

提交回复
热议问题