When I commenting all routes I getting this error. Please say me, what are the closure routes? And why showing this error
1 Answers
0
votes
A closure is an anonymous function which is used to define routes without an action:
Route::get('/test', function () {
return 'hello world';
});
The example above returns hello world
when you call the route /test
in your browser.
You can't cache routes that are referencing a closure.
There are two routes using closures in a default Laravel app: in the files routes/api.php
and routes/web.php
. Remove them or move them to a controller and you are able to cache your routes.
Here's an issue in the Laravel framework repository which is discussing this behaviour.
routes:cache
? – Dan