- How do I install soyhuce/next-ide-helper in a Laravel project?
- Install it as a development dependency with composer require --dev soyhuce/next-ide-helper, publish the package configuration, and run the package's generation command. Because it only writes IDE helper stub files, it does not need to be installed in production. Commit the generated stubs or regenerate them locally, depending on your team's workflow. Pin the version with your lockfile so patch updates are intentional.
- Is soyhuce/next-ide-helper a replacement for barryvdh/laravel-ide-helper?
- It is a rebuilt IDE helper aimed at producing richer phpDoc, model metadata, and facade annotations, so it overlaps with barryvdh/laravel-ide-helper. Running two generators can produce conflicting or duplicated stubs, so evaluate both against your models and standardize on one. Do not assume drop-in parity; compare output before removing an existing helper.
- Which Laravel and PHP versions does next-ide-helper support?
- The package targets modern Laravel projects on PHP 8.1 and newer. Always validate the declared composer.json constraints against your pinned Laravel minor and PHP version before adopting. Release 2.2.3 is a patch-level change, so it should be a drop-in upgrade from 2.2.2 with no API or configuration changes. Pin to ^2.2 with a lockfile to control updates.
- Does soyhuce/next-ide-helper affect production runtime?
- No. It is developer tooling that generates stub files for editors and static analyzers; it does not register service providers that alter production behavior, ship migrations, or intercept requests. Install it with require --dev and keep it out of production deployments. A defect in the generator degrades autocompletion quality, not application runtime.
- What does the AsCollection cast fix in next-ide-helper 2.2.3 change?
- Version 2.2.3 fixes how the generator handles Laravel's AsCollection attribute cast when producing phpDoc types. Previously it could emit an incorrect or unhelpful type, which hurt autocompletion for models storing collection-shaped JSON data. The fix makes generated hints reflect a Collection more accurately. It is a patch upgrade from 2.2.2 with no config changes signaled.
- How does next-ide-helper handle custom Eloquent cast classes?
- Type inference for casts is heuristic, so custom cast classes and third-party attribute casts can still produce incorrect or vague stubs beyond the AsCollection fix. Treat generated output as advisory and verify it in the IDE for models that use custom casts. Test at least one custom-cast model during evaluation and adjust or override generated hints if needed. Cast handling is a moving target as Laravel and your cast classes evolve.
- Can I use next-ide-helper in any Laravel application?
- It is most useful in Laravel codebases that rely on Eloquent casts, facades, and static analysis in PhpStorm or VS Code Intelephense. It is a low-coupling dev dependency with no database or infrastructure footprint, so integration is mainly publishing config and running generation. Codebases with collection-shaped JSON casts benefit directly from the 2.2.3 AsCollection fix. Validate version constraints against your stack first.
- How do I prevent generated IDE helper stubs from drifting in CI?
- The provided context does not document a built-in CI check mode, so drift is typically caught by regenerating and diffing. Add the generation command to composer scripts such as post-update, and run generation in CI followed by a git diff check. Regenerate as part of model-change pull requests. Keep generated files committed if your team wants reviewable stub changes.
- Is soyhuce/next-ide-helper safe to add as a require-dev dependency?
- Yes, the technical risk is low because the package sits entirely outside the runtime path and only generates IDE stubs. The blast radius of a bad release is wrong type hints, not production breakage. Add it on a branch with require-dev, pin to ^2.2 with a lockfile, and diff generated output against current IDE behavior. Do not promote it to a production dependency.
- What should I check before adopting next-ide-helper alongside existing IDE tooling?
- Resolve overlap with barryvdh/laravel-ide-helper by comparing generated stubs and choosing a single generator rather than running both. Confirm the PHP and Laravel support matrix matches your pinned stack. Test models using AsCollection and custom casts to see whether hints improve. Also review maintainer cadence and bus factor, and decide how generated stubs will be refreshed and checked in CI.