phplaravelcachinglaravel-routinglaravel-cache

Laravel route issue, alwyas use php artisan optimize after create new route


i have laravel issue, after create new route, laravel cant detect that, i always use php artisan:optimize after create new route url. What Should i do to fix this issue ?

enter image description here

I hope that after creating a new route I no longer need to do php artisan optimize


Solution

  • Stop using php artisan optimize during development. It caches several things, including the routes. You can clear the route cache with php artisan route:clear, or undo all the optimize caching with php artisan optimize:clear.

    optimize is good for production use (make it part of your deployment process), but will potentially cause you quite a bit of pain like this during local development.