Laravel Route Cache Limitation


php artisan route:cache

Laravel Route Cache Limitation

php artisan route:cache


Laravel's php artisan route:cache does not work if you are using closure on your routes. To enable this feature, make sure all your routes are using controllers! 

This error will raise if you are using closure on routes.

[LogicException]
  Unable to prepare route [blog/veritatis-consequatur-ipsam-aut-eveniet-consequatur] for serialization. Uses Closure.

 

UPDATE:

Just found out that this is documented. ¯\_(ツ)_/¯

https://laravel.com/docs/5.4/controllers#route-caching


  • Laravel
  • Routes