Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Redis Ide Helper Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Getting Started

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.

  1. Install (dev only): composer require --dev huangdijia/laravel-redis-ide-helper
  2. Publish config (optional): php artisan vendor:publish --provider="Huangdijia\LaravelRedisIdeHelper\ServiceProvider" (or the tag listed in the README).
  3. Generate the helper: look in your README for the artisan command — typically php artisan redis:ide-helper or php artisan ide-helper:redis. Run php artisan list | grep -i redis to find the exact signature.
  4. Wire it into your IDE: the package writes a helper file (commonly _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).
  5. First use case: open a Blade/PHP file, type 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.0 for team/production branches.

Implementation Patterns

  • Commit the generated file in projects with mixed IDE setups. Default .gitignore often excludes it, but shipping _ide_helper_redis.php avoids every teammate re-running the generator after each composer install.
  • Regenerate on dependency changes, not on runtime. Hook into Composer's post-install-cmd/post-update-cmd scripts:
    "scripts": {
      "post-install-cmd": ["@php artisan redis:ide-helper"],
      "post-update-cmd":  ["@php artisan redis:ide-helper"]
    }
    
  • Multiple connections: Laravel apps often define 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.
  • Pair with 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.
  • CI drift check: run the generator in CI and fail if the committed helper is stale (git diff --exit-code _ide_helper_redis.*). This keeps signatures in sync as you add Redis usage.
  • Version-specific usage: if you're on v3 today, upgrade path is typically 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.

Gotchas and Tips

  • Major version breakage: v4.0.0-beta.1 has no detailed changelog supplied (only a compare link). Before adopting, diff 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.
  • Connection availability matters: the generator introspects each configured Redis connection. If a connection is unreachable (local dev without a running Redis, CI without a service container), the command will fail or skip it — scope to reachable connections or run with a test Redis in CI.
  • Driver asymmetry: signatures can differ depending on whether the app uses 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).
  • Stale autocomplete after regenerating: PhpStorm needs "File → Invalidate Caches / Restart"; VS Code + Intelephense needs "Intelephense: Index workspace". Don't debug the package until your IDE cache is cleared.
  • Octane/queue workers: the helper is a static file for the IDE, not runtime — you don't need to restart anything for Octane. But if you run the generator inside a container, make sure the output path is mounted so your host IDE sees the file.
  • Config extension points: custom output filename, custom class name for the helper Redis class, and per-connection generation are the usual knobs. Re-publish the config after major upgrades instead of hand-merging.
  • Debugging: run with -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).
  • Don't rely on it for correctness: the helper reflects the driver's method surface, not your app's guardrails. It won't tell you which Redis commands are safe in a multi-tenant or rate-limited context — treat it purely as autocomplete.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle