Sunday, 28 February 2021

laravel Unable to prepare route … for serialization. Uses Closure

 The problem is a route which uses a Closure instead of a controller, which looks something like this:

//                       Thats the Closure
//                             v 
Route::get('/some/route', function() {
    return 'Hello World';
});

Since Closures can not be serialized, you can not cache your routes when you have routes which use closures.


https://stackoverflow.com/questions/45266254/laravel-unable-to-prepare-route-for-serialization-uses-closure

No comments:

Post a Comment