You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Actually, it's because generics aren't supported correctly. I tried to fix it on my fork, but it's a bit hard because of the forked phpdoc package that's included.
It should return a TModel, which is defined as template at the top of the Builder class:
Wat worked for me (it's far from ideal though), is replacing the @mixin \Eloquent for the @mixin Builder<$this> in each model phpdoc.
This gives the following result:
It can be done using this code snippet (requires the GNU sed version):
find app/Models -type f -name '*.php' -exec sed -i 's/@mixin Eloquent/@mixin \\Illuminate\\Database\\Eloquent\\Builder<\$this>/g' {} +
find app/Models -type f -name '*.php' -exec sed -i 's/@mixin \\Eloquent/@mixin \\Illuminate\\Database\\Eloquent\\Builder<\$this>/g' {} +
Versions:
Description:
::find returns Illuminate\Database\Eloquent\Collection|null|TModel
::first returns Illuminate\Database\Eloquent\TValue|null
The text was updated successfully, but these errors were encountered: