This is regarding route cache on 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.
Question : How can I remove the route cache on 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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With