Help us continue to build and maintain our open source projects. We’re a small team of independent developers and every little bit helps.
Laravel Redis Configuration for Acorn
View as Markdown:
Acorn provides Laravel integration with WordPress, which means that Laravel's Redis setup can be configured to work on your WordPress sites.
We recommend referencing the Laravel docs on Redis for a complete understanding of the integration.
Requirements
The PhpRedis PECL extension, or the predis/predis package are required in order to use Redis.
Configuration
Add the Laravel Redis package as a dependency:
$ composer require illuminate/redis
Update config/app.php to add the Redis Service Provider:
Roots\Acorn\Providers\AcornServiceProvider::class,
Roots\Acorn\Providers\RouteServiceProvider::class,
Roots\Acorn\View\ViewServiceProvider::class,
+ Illuminate\Redis\RedisServiceProvider::class,
Update config/app.php to add the Redis facade:
'aliases' => Facade::defaultAliases()->merge([
// 'ExampleClass' => App\Example\ExampleClass::class,
+ 'Redis' => Illuminate\Support\Facades\Redis::class
])->toArray(),
Last updated