- What is tillkruss/laravel-phpredis and what does it do?
- It is a Laravel integration that registers a phpredis driver and connection class so Laravel uses the native PhpRedis PHP extension instead of the default Predis client. Existing Redis:: calls, cache, sessions, and queues keep working unchanged. It provides faster, lower-overhead Redis connections and access to the extension's full feature set.
- Why should I use PhpRedis instead of Predis in Laravel?
- PhpRedis is a native C extension, so it typically has lower overhead and uses less memory per connection than Predis, which is a pure-PHP client. This package makes the switch drop-in by registering a phpredis driver while preserving Laravel's Redis API. It also exposes native support for pipelines, transactions, and Lua scripting.
- How do I install tillkruss/laravel-phpredis?
- Install it with Composer and make sure the PhpRedis PHP extension is installed and enabled in your environment. Then configure a Redis connection in config/database.php using the phpredis driver. Follow the package README for any service-provider or configuration details specific to your Laravel version.
- How do I configure a phpredis connection in Laravel's database.php?
- Add or update a connection in the redis block of config/database.php and set its driver to phpredis. You can use standard host, port, password, and database options plus package-supported options such as timeout, persistent, and prefix. Keep existing key prefixes consistent to avoid cache, session, or queue misses.
- Which Laravel and PHP versions does tillkruss/laravel-phpredis support?
- The available release notes do not list exact Laravel, Lumen, or PHP version constraints, so check the package composer.json and README before upgrading. Confirm compatibility with your application's framework version and your installed PhpRedis extension version. Test on a branch with your actual Laravel or Lumen and PHP versions rather than assuming broad support.
- Does tillkruss/laravel-phpredis support Lumen?
- Yes, Lumen support is called out as an additive feature in the v1.1.0 release notes. Lumen's bootstrap and config loading differ from Laravel, so verify service-provider registration and config loading explicitly. Add smoke tests for cache, sessions, queues, and direct Redis access in your Lumen service.
- Can I use this package with Redis Cluster or Sentinel?
- The package supports standalone Redis instances, clusters, and Sentinel, and v1.1.0 added RedisCluster support. Confirm the required Redis client and topology details for your environment, including auth and TLS behavior if your provider uses them. Test against the same managed Redis or cluster setup you run in production.
- What do the timeout, persistent, and prefix options do?
- timeout controls how long the client waits during Redis connection or operation handling, so tune it for your network and Redis provider. persistent enables persistent connections, which can reduce connection overhead but may risk stale or exhausted connections under load if not sized and tuned carefully. prefix adds a key namespace; changing it can make existing cache, session, or queue keys invisible, so standardize it before rollout.
- Is tillkruss/laravel-phpredis a drop-in replacement for Laravel's default Redis client?
- It is designed as a drop-in replacement for the default Predis-based driver by registering a phpredis driver and connection class, so existing Redis:: calls, cache, sessions, and queues keep working. You still need the PhpRedis extension installed and your Redis configuration updated to use the phpredis driver. Validate key prefixes and connection options before switching production traffic.
- What should I check before using this package in production?
- Test cache, session, queue, pipeline, transaction, and Lua script paths against the same Redis provider you use in production. Validate cluster failover, auth and TLS behavior, timeout settings, persistent connection behavior, and key-prefix compatibility in staging first. Canary a small production slice and keep a documented rollback to your prior package version and Redis configuration.