Php 依赖注入Laravel缓存系统
是否有注入laravel缓存系统并访问增量方法的方法Php 依赖注入Laravel缓存系统,php,laravel,laravel-5,Php,Laravel,Laravel 5,是否有注入laravel缓存系统并访问增量方法的方法 \Cache::increment('key') 到目前为止,我有以下,但没有增加的方法 /** * @var Cache\Repository */ protected $cache; /** * RateLimiter constructor. * * @param Cache\Repository $cache */ public function __construct(Cache\Repository $cache)
\Cache::increment('key')代码>
到目前为止,我有以下,但没有增加的方法
/**
* @var Cache\Repository
*/
protected $cache;
/**
* RateLimiter constructor.
*
* @param Cache\Repository $cache
*/
public function __construct(Cache\Repository $cache)
{
$this->cache = $cache;
}
我尝试过注入Cache\Store
,但这是不可实例化的
编辑:
使用light\Contracts\Cache代码>没有显示在上面的摘录中,但它在那里
有什么建议吗?根据下面的说明,缓存
门面的下划线类是照明\缓存\存储库
,而不是缓存\存储库
这就是我在做的,我没有在问题中显示使用声明