Search code examples
laravelrouteslaravel-artisan

Laravel routes not updating on server


I have added a Laravel route to the web.php file and everything works fine locally but on deployment, it says that page is not found. The thing is that the newly added routes seem to be in web.php on the server as well but php artisan route:list does not display these new routes. Most of the solutions here recommend to run php artisan route:clear and then php artisan route:cache but there is not any routes.php file in /bootstrap/cache/ directory so that routes were not caching anyways.


Solution

  • Dont run route:cache just clear and it will auto get it cached from your routes

    php artisan route:clear
    php artisan config:clear