use Redis; //通过别名引用会报错

今天尝试使用了 Laravel 的 redis 结果报了如下错误.

Non-static method Redis::xxx() cannot be called statically, assuming $this from incompatible context

因为自己一直在用 Redis 很容易就想到了和既有的 Redis 扩展冲突了, 如果想用 Laravel 自带的 Redis 可以是使用, 如下代码:

use Illuminate\Support\Facades\Redis as Redis;

相关文章:

  • 2021-09-08
  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
  • 2022-01-11
  • 2021-11-03
  • 2021-07-16
  • 2022-01-26
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-10
  • 2021-05-07
  • 2021-09-30
相关资源
相似解决方案