2

I've looked around the web and found you can clear the cache via:

php artisan cache:clear 

I am looking for a solution where you can turn off the cache in a dev environment. I do not want to run the above cmd everytime.

 return Cache::remember('my-key', 60, function() { //get page }); 

So above I check the cache, this occurs throughout my app, is there a simple way to disable it in a dev environment?

2
  • What I currently use as a workaround is define a cacheTime config, and set it to 0 in dev, and the desired amount in production. I use this configuration as the second argument everywhere. Commented Aug 14, 2015 at 11:41
  • I tried setting it to 0, but this seems to make the cache persist 'forever'. Commented Aug 14, 2015 at 11:58

1 Answer 1

2

Set your cache driver to array in .env file for your DEV environment. This way cache will be wiped out at the end of every request, but you'll be able to use Cache facade.

CACHE_DRIVER=array 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.