lumen-配置redis

1.composer require illuminate/redis。php

2.複製vendor/laravel/lumen-frameword/config/database.php配置文件到app同級目錄config下。laravel

3.app.php文件配置$app->register(\Illuminate\Redis\RedisServiceProvider::class);redis

4.修改.env  CACHE_DRIVER=redis
app

5.使用app('cache')->put($key, $value, $times);$app->get($key);composer

相關文章
相關標籤/搜索