Marinario Agalliu
Marinario Agalliu

Reputation: 1179

Laravel 8, why do I have to route:cache for every change I made in routes/web.php?

I've been working on different projects with laravel 8 and the 'problem' (if it is really a problem) is that for every change I made on routes/web.php I have to route:cache every freaking time.

If I make a change and route:list, the new changes will not be displayed. Is this thing correct or is there any bug? If so is there any way not to route:cache or route:clear for every change that is made on web.php?

Thank you! happy coding!

Upvotes: 2

Views: 6002

Answers (3)

Ahmed Saad
Ahmed Saad

Reputation: 53

I recommend you to use php artisan optimize instead.

Upvotes: 0

okcpilot
okcpilot

Reputation: 136

php artisan route:clear

This will clear your route cache and allow you to freely make updates to your routes file without needing to recache. In development, you should not be caching anything.

Upvotes: 10

Carlton
Carlton

Reputation: 5721

If you're using vagrant/homestead combo check the date on your machine, if I go on standby for a few hours the time seems to drift.

So any changes I was making to routes, wasn't being picked up and the only thing that would clear it was route:clear or config:clear

Restarting machine worked but also a vagrant halt & vagrant up might work too.

Upvotes: 0

Related Questions