Open mycarrysun opened 3 years ago
whereIn
isn't the only "affected" one, I mean I can see the same with whereNull
and probably lots of others 🤷♀️
Yea - I hadn't tested the other ones so wasn't sure what to post here but figured they could all be annotating the wrong return type.
I'm having the same problem, but I experienced it through FooModel::whereIn()->get()
returning Illuminate\Support\Collection
instead of Illuminate\Database\Eloquent\Collection
which should be returned from Illuminate\Database\Eloquent\Builder::get()
.
I guess while not extra helpfull me too
Versions:
Description:
The generated
whereIn
method for theEloquent
mixin has\Illuminate\Database\Query\Builder
for the return object. When actually using thewhereIn
method on a model it actually returns\Illuminate\Database\Eloquent\Builder
. I think the auto generated doc block should be changed to have the typehint ofEloquent
builder instead.Steps To Reproduce:
Now running this will produce an error (generate the models helper first with
php artisan ide-helper:models
):