laravel-ide-helper
laravel-ide-helper copied to clipboard
Is @mixin \Eloquent necessary for model classes?
Versions:
- ide-helper Version: 2.12
- PHP Version: 8.0.14
Question:
Is there any benefit in adding @mixin \Eloquent
to model classes?
I only ask because Eloquent
is just a facade for \Illuminate\Database\Eloquent\Model::class
which the model will already be extending.
Also, this seems to require the ide-helper:generate
command to have run for the facade to be resolved.
Previous mention: https://github.com/barryvdh/laravel-ide-helper/issues/811#issuecomment-667159676
If there isn't any benefit to it being included, I'd be more that happy to create a PR :)
It is needed to autocomplete \Illuminate\Database\Eloquent\Builder
class methods such as where
or find
Example- User::where('id', 1)
or User::find(1)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this issue is still present on the latest version of this library on supported Laravel versions, please let us know by replying to this issue so we can investigate further. Thank you for your contribution! Apologies for any delayed response on our side.