barryvdh/laravel-ide-helper

Wrong return type get() method

rafli-sss opened this issue · 1 comments

Versions:

  • ide-helper Version: 3.0.0
  • Laravel Version: 11.0.5
  • PHP Version: 8.2.16

Description:

I'm using vscode with intelephense

User::with('role')->get(); // return Illuminate\Database\Eloquent\Collection
User::orderBy('username')->get(); // return Illuminate\Support\Collection (wrong)

Steps To Reproduce:

  • php artisan ide-helper:generate
  • php artisan ide-helper:models -M
mfn commented

I don't have L11 yet, so I can't say if that is the cause.

But on L10 with PhpStorm this works correctly; maybe it's a vscode issue (and thus unrelated to ide-helper)
image
image

In both cases it's showing Collection extends Collection, which means it's an Eloquent collection extending the base Support collection.