~/docs
Resonate
Resonate
0.x 0.9.0, current
Laravel RESP3 Cache
Toggle sidebar
Laravel RESP3 Cache
webpatser/laravel-resp3-cache 0.9.0

Laravel RESP3 Cache 0.x

Installation

Install ext-resp3 and the package, then switch the Laravel Redis client to resp3.

Version 0.9 requires PHP ^8.6, ext-resp3 ^0.3 and Laravel 11, 12 or 13. On PHP 8.4 or 8.5, stay on laravel-resp3-cache 0.8.x with ext-resp3 0.2.x.

Install the extension

The package builds on the php-resp3 extension, which has to be installed first:

pie install webpatser/php-resp3:^0.3

Install the package

composer require webpatser/laravel-resp3-cache

The service provider Resp3\Laravel\Resp3ServiceProvider is registered through package discovery. It registers the resp3 Redis client and the resp3 cache driver.

Switch the Redis client

In config/database.php, set the client to resp3:

'redis' => [
'client' => env('REDIS_CLIENT', 'resp3'),
'default' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'port' => env('REDIS_PORT', 6379),
'password' => env('REDIS_PASSWORD'),
'database' => env('REDIS_DB', 0),
],
],

That is the whole opt-in. The standard redis cache driver picks up the new client through Laravel's RedisManager extension hook.

Run the tests

vendor/bin/phpunit --testsuite=Unit
php -d extension=/path/to/resp3.so vendor/bin/phpunit --testsuite=Feature

Feature tests target 127.0.0.1:6379. Point them at another server with RESP3_TEST_HOST and RESP3_TEST_PORT. The repository's CI runs the suite on Valkey 8.1, Valkey 9.1 and Redis 8.10 on PHP 8.6, plus the cluster suite.