psalm / psalm-plugin-laravel

A Psalm plugin for Laravel
MIT License
307 stars 72 forks source link

Support Model::select() forward call #216

Open caugner opened 2 years ago

caugner commented 2 years ago

Is your feature request related to a problem? Please describe. Psalm seems to be unable to infer the type of the following assignment:

$users = User::select('name', 'email');

(The correct type would be Illuminate\Database\Eloquent\Builder<User>.)

Describe the solution you'd like Support this syntax.

Describe alternatives you've considered Workaround is to call User::query()->select('name', 'email') directly.

Additional context (None.)