0

我有以下课程:

namespace App\Providers;
 
use AlternativeLaravelCache\Provider\AlternativeCacheStoresServiceProvider;
 
/**
 * Note: Using 'dev-master' for the library. If *composer update* causes
 * issue, then refer to library's stable release version in composer.json
 * and update it.
 */
class CacheStoresServiceProvider extends AlternativeCacheStoresServiceProvider
{
    static protected $redisDriverName = 'redis'; // 'redis','altredis'
 
    static protected $fileDriverName = 'file'; // 'file','altfile'
 
    public function register()
    {
        if (env('CACHE_DRIVER') == 'array') {
            static::$fileDriverName = 'altfile';
        }
 
        parent::register();
    }
 
}

使用它会导致以下错误

找不到类“AlternativeLaravelCache\Provider\AlternativeCacheStoresServiceProvider”

4

1 回答 1

0

您必须在 config/app.php 文件中添加它

'providers' => [

    ...,
    \AlternativeLaravelCache\Provider\AlternativeCacheStoresServiceProvider::class,
],
于 2022-01-18T14:47:02.597 回答