Inaccurate Method Signatures in _ide_helper.php: Optional Parameters Reported as Required by Intelephense

Author: amoktarCreated May 25, 2026Updated Jul 31, 2026
Labelsbug

Describe the bug When using methods like selectRaw() or find() on an Eloquent model, PHP Intelephense throws a Not enough arguments error if the optional arguments are not explicitly provided.

It appears the generated _ide_helper.php does not correctly assign the default values for these methods. Specifically:

  • selectRaw($expression, $bindings = []) is generated without = [].
  • find($id, $columns = ['*']) is generated without = ['*'].

To Reproduce Steps to reproduce the behavior:

  1. Run php artisan ide-helper:generate (and/or ide-helper:models).
  2. Write an Eloquent query using these methods with only the required arguments:
php
   Section::query()->selectRaw("id, province_id, title");
   Section::find(1);
  1. Observe the Intelephense errors in VS Code (e.g., Not enough arguments. Expected 2. Found 1. intelephense(P1005)).

Expected behavior The optional arguments in Laravel's underlying classes should retain their default values in the generated stubs (e.g., array $bindings = [] and $columns = ['*']). This prevents IDEs and static analysis tools from flagging them as missing required arguments.


Environment details: PHP Version: 8.2 Laravel Version: 12.60.2 IDE Helper Version: 3.7.0

IDE: Version: 1.121.0 (user setup) Commit: f6cfa2ea2403534de03f069bdf160d06451ed282 Date: 2026-05-19T11:51:53+02:00 Electron: 39.8.8 ElectronBuildId: 13870025 Chromium: 142.0.7444.265 Node.js: 22.22.1 V8: 14.2.231.22-electron.0 OS: Windows_NT x64 10.0.26100

PHP Intelephense: bmewburn.vscode-intelephense-client - Version 1.18.3


Thank you for this amazing repo.

Source: barryvdh/laravel-ide-helper