barryvdh / laravel-ide-helper

IDE Helper for Laravel
MIT License
14.17k stars 1.16k forks source link

Query builder methods on relationships #1248

Closed jackhugh closed 3 years ago

jackhugh commented 3 years ago

Is there any way to get query builder methods to autocomplete on relationships?

Using vscode, intelephense with ide-helper:models -M

eg

// no error but exists method will not autocomplete
$this->hasMany(Foo::class)->exists();

// in this case the builder method autocompletes as getQuery returns a builder instance
$this->hasMany(Foo::class)->getQuery()->exists();
jackhugh commented 3 years ago

Premium intelephense seems to have solved the issue.