How to disable route cache during development. (without artisan optimize or cache : clear) I don't want to use artisan optimize or clear: cache everyt ime I update my route files.
@jaynarayan what if you just set a command that runs every certain time in your local development to clear cache?
I am looking for disable caching. Is there any config option or other way?
@tisuchi this is not working for route:cache
Just run artisan route:clear then leave it alone?
The routes are only cached when you run route:cache or optimize
You DO NOT need to mess with the cache drivers.
ONLY run route:cache or optimize as part of a production deployment script
This is the correct answer. You just run php artisan route:clear and don't run php artisan route:cache again. If you run something like php artisan optimize it will re-cache your routes and you'll be back to where you started.
@zvineyard The answer had already been marked as the best answer. Why did you need to reply a half-decade later saying as much?
I don't cache anything in my deployment script but routes are still cached for some reason. It's not documented anywhere.
@Snapey to disable the cache of routes
@ArturMamedov to disable the cache of routes,
DO NOT run php artisan route:cache and,
DO NOT run php artisan optimize
That is all you need to do.
Please sign in or create an account to participate in this conversation.