laravel-ide-helper icon indicating copy to clipboard operation
laravel-ide-helper copied to clipboard

Is @mixin \Eloquent necessary for model classes?

Open rwdevguy opened this issue 2 years ago • 2 comments

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 :)

rwdevguy avatar Jan 27 '22 18:01 rwdevguy

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)

mridul89 avatar Mar 04 '22 18:03 mridul89

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.

stale[bot] avatar Jun 12 '22 19:06 stale[bot]