Skip to content

WP Packages is our new WPackagist replacement that's 17x faster and updates every 5 minutes

Acorn

Roots is an independent open source org, supported only by developers like you. We’ve been improving the WordPress developer experience since 2011, and your support keeps it independent.

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