Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to clear Laravel route caching on server

This is regarding route cache on localhost

About Localhost

I have 2 routes in my route.php file. Both are working fine. No problem in that. I was learning route:clear and route:cache and found a small problem below.

if I comment any one route in my route.php file and then run below command

php artisan route:cache 

This will keep the route disabled because the route list is in cache now. Now, go to route.php file and try to remove commented route and then try to run that enabled url. still it will show 404 because I need to remove cache by using below command

php artisan route:clear 

So far everything is understood in localhost. No problem in that.

After deploying on shared hosting server on godaddy

Question : How can I remove the route cache on server?

like image 633
Pankaj Avatar asked Jun 17 '16 10:06

Pankaj


People also ask

How do I clear the cache in Laravel on a server?

The following is the syntax to clear cache in Laravel is given below: php artisan cache: clear. php artisan config: clear. php artisan cache: clear.

How do I clear my routing cache?

Open an elevated command prompt. In the elevated command prompt type the command “arp -a” to view the ARP cache, to wipe the ARP cache run the command “arp -d”. The -a flag instructs the program to display the ARP cache, the -d flag instructs it to delete the cache.

What is php artisan route cache?

With Route Cache When you run php artisan routes:cache , an instance of Illuminate/Routing/RouteCollection is built. After being encoded, the serialized output is written to bootstrap/cache/routes. php . Application requests will always load this cache file if it exists.


1 Answers

If you want to remove the routes cache on your server, remove this file:

bootstrap/cache/routes.php

And if you want to update it just run php artisan route:cache and upload the bootstrap/cache/routes.php to your server.

like image 86
Dees Oomens Avatar answered Sep 23 '22 21:09

Dees Oomens