tutorigo/laravel-ide-macros
Bring IDE autocompletion to your Laravel macros. This package scans your application for registered macros and generates helper files, so PhpStorm and other IDEs recognize macro methods with full type hints and suggestions.
Architecture fit: laravel-ide-macros is a developer-tooling package that generates IDE-facing stub files describing Laravel macro methods (methods added at runtime via Macroable::macro()), so IDEs can autocomplete and type-check calls that static analysis would otherwise miss. It sits purely in the dev/static-analysis layer — it ships no runtime service provider logic that affects request handling, and its output is a generated file consumed by the IDE/static analyser. This makes it architecturally non-invasive: it complements, rather than competes with, barryvdh/laravel-ide-helper, and only matters for teams that lean heavily on macros (custom collections, query builders, response/request macros, string helpers).
Integration feasibility: High. The 1.6.0 release is additive: Illuminate\Http\Request support extends coverage to request macros (a very common extension point), and TestResponse/TestView support extends coverage into test-authored macros, which previously would have appeared as undefined methods in test code. The Laravel 9 dependency bump signals active maintenance and version currency. All three changes reduce friction rather than add it — no new configuration surface, no new runtime dependency.
Technical risk: Low, with two caveats worth tracking. First, the package's value is entirely derived from the accuracy of generated stubs; if macro registration happens conditionally (feature flags, environment guards, service-provider ordering), the generated file can silently diverge from what actually exists at runtime. Second, IDE-helper-style packages are tightly coupled to Laravel internals; the explicit "bump dependencies for Laravel 9" is a reminder that major-version upgrades will require coordinated package bumps. Because the artefact is dev-only, the blast radius of a bad generation is limited to red squiggles and false positives in the IDE — not production behaviour.
Key questions:
laravel-ide-helper in our generation pipeline, and does one overwrite the other's output?Stack fit: Suitable for any Laravel 8/9-era codebase using Composer and a modern IDE (PhpStorm, VS Code + Intelephense). It is a require-dev dependency by design — it should never land in production autoload paths. The 1.6.0 additions map cleanly onto existing team practices: Request macros are a common pattern for request-shape normalisation, and TestResponse/TestView macros show up in teams that build custom assertion helpers.
Migration path: Effectively zero-migration for new adopters: composer require --dev, optionally publish config, run the generation command, and point the IDE at the output file. For teams already running the package, 1.6.0 is a non-breaking minor — regenerating stubs after upgrade picks up the new Request/TestResponse/TestView coverage. The only action item is the Laravel 9 dependency bump: confirm the host application and any pinning constraints (CI images, other dev dependencies) also resolve cleanly on Laravel 9 before bumping in a shared branch.
Compatibility: The release explicitly targets Laravel 9, which is the headline compatibility signal. Verify coexistence with laravel-ide-helper (separate output files, both referenced from the IDE config) and with any static-analysis baseline files. PHP version constraints should be checked against the team's minimum supported runtime.
Sequencing:
require-dev and generate stubs; validate autocomplete on a known Request macro.post-autoload-dump) or a documented onboarding step so new developers get the file without tribal knowledge.Maintenance: Minimal. The package is passive — no daemon, no runtime hooks, no scheduled work. Ongoing cost is bounded to (a) regenerating stubs when macros change, and (b) keeping pace with Laravel major versions, which 1.6.0 demonstrates the maintainer is doing. The realistic long-term risk is upstream abandonment of a small, single-maintainer package; mitigated by the fact that removal is a one-line composer remove with no production fallout.
Support: Low support burden. Failures surface as IDE warnings, not incidents, and are self-diagnosed by "did you regenerate?". The main support need is onboarding documentation: one paragraph explaining what the generated file is, why it exists, and how to refresh it.
Scaling: Scales linearly and trivially — generation cost is proportional to the number of registered macros, which is small even in large applications. No impact on request throughput, deployment time, or infrastructure. The only scaling concern is team-wide freshness: with many developers, a committed generated file reduces drift; a gitignored one requires reliable automation.
Failure modes:
laravel-ide-helper if file paths are misconfigured.Ramp-up: Near-zero. A developer can adopt it in under fifteen minutes: install, generate, configure the IDE include path. The conceptual overhead is one sentence ("it teaches your IDE about macros"). The 1.6.0 additions modestly widen the useful surface — Request and TestResponse/TestView macros are exactly the places teams most often lose autocomplete — so the value-per-minute-of-setup ratio improves, particularly for teams with heavy custom test assertion helpers.
How can I help you explore Laravel packages today?