huangdijia/laravel-redis-ide-helper
Laravel Redis IDE Helper generates IDE autocompletion metadata for Laravel's Redis facade, exposing dynamic Redis commands and connection methods to your editor. Improve PhpStorm/IntelliJ discovery and reduce guesswork when working with Redis in Laravel apps.
This package generates PHPDoc/IDE helper files for Laravel's Redis facade so your editor autocompletes commands like Redis::set(), Redis::hgetall(), and Redis::lpush() with correct signatures. It is a dev-time convenience, not a runtime dependency.
composer require --dev huangdijia/laravel-redis-ide-helperphp artisan vendor:publish --provider="Huangdijia\LaravelRedisIdeHelper\ServiceProvider" (or the tag listed in the README).php artisan redis:ide-helper or php artisan ide-helper:redis. Run php artisan list | grep -i redis to find the exact signature._ide_helper_redis.php in the project root). Add it to your IDE's indexed paths (PhpStorm indexes the root automatically; VS Code + Intelephense needs it in the workspace).Redis:: and confirm the IDE lists methods like get, set, eval, pipeline. If it doesn't, reindex and rebuild IDE caches.Beta note: v4.0.0-beta.1 is a major bump from 3.0.5. Pin it explicitly:
composer require --dev "huangdijia/laravel-redis-ide-helper:^4.0@beta". Until 4.0.0 is stable, stay on^3.0for team/production branches.
.gitignore often excludes it, but shipping _ide_helper_redis.php avoids every teammate re-running the generator after each composer install.post-install-cmd/post-update-cmd scripts:
"scripts": {
"post-install-cmd": ["@php artisan redis:ide-helper"],
"post-update-cmd": ["@php artisan redis:ide-helper"]
}
default, cache, session, and queue Redis connections. Point the generator at the connections you actually call from application code (config key is usually include_connections or connections); generating every connection pollutes your IDE's method list with duplicate symbols.barryvdh/laravel-ide-helper: that package covers models/facades/containers; this one covers Redis. Both are typically committed together in a _ide_helper*.php cluster at the project root.git diff --exit-code _ide_helper_redis.*). This keeps signatures in sync as you add Redis usage.composer require --dev huangdijia/laravel-redis-ide-helper:^4.0@beta, then re-publish config (vendor:publish --force) because v4 beta likely reshapes config keys and command signature. Run php artisan list and diff the generated helper against the pre-upgrade file to confirm parity.config/redis-ide-helper.php, the artisan command name, and the generated file header between v3.0.5 and v4.0.0-beta.1 — expect at minimum a raised PHP requirement (likely 8.2+), possible Laravel 11 minimum, and potentially renamed namespaces/command signature.phpredis or predis. Generate against the same client that production uses; otherwise your IDE will suggest methods the runtime client doesn't have (or miss server-side commands installed via modules like RedisBloom/RediSearch).Redis class, and per-connection generation are the usual knobs. Re-publish the config after major upgrades instead of hand-merging.-vvv; check storage/logs/laravel.log if generation silently no-ops. A common cause is the config's connections array being empty because the published config wasn't loaded (cached config: php artisan config:clear).How can I help you explore Laravel packages today?