Disable the cache?

2019-07-11 07:48发布

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?

1条回答
forever°为你锁心
2楼-- · 2019-07-11 08:17

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
查看更多
登录 后发表回答