I'm not getting autocompletion on column names within a whereHas on a polymorphic relationship. The code works fine, but phpstorm is only trying to autocomplete columns on the tags table. I expected it to try and autocomplete columns on the taggables table, but maybe I'm wrong in assuming so.
I'm generating helper files from the plugin not via the barry ide helper package.
Here is the code:
$runs = Run::query()
->whereRelation('user', 'id', Auth::user()->id)
->whereHas('tags', function (Builder $query) use ($tagIds) {
$query->whereIn('tag_id', $tagIds); // tag_id is not auto completing
})
->with('tags')
->get();
I will however get autocompletion for columns that exist on the tags table (please see "where has autocomplete on tags table" screenshot)
Please let me know if I can provide more information or if I'm wrong in assuming that the taggables table columns would not expect to autocomplete.
Sorry for the bombarding of photos but I just want to post all the models/relationships involved
Hi, Michael. Yes, Laravel Idea doesn't understand morph relations very well. We will try to improve this. Thanks for "bombarding of photos". They explain the issue very clear :)
Bug description
Hello,
I'm not getting autocompletion on column names within a
whereHas
on a polymorphic relationship. The code works fine, but phpstorm is only trying to autocomplete columns on thetags
table. I expected it to try and autocomplete columns on thetaggables
table, but maybe I'm wrong in assuming so.I'm generating helper files from the plugin not via the barry ide helper package.
Here is the code:
I will however get autocompletion for columns that exist on the
tags
table (please see "where has autocomplete on tags table" screenshot)Please let me know if I can provide more information or if I'm wrong in assuming that the
taggables
table columns would not expect to autocomplete.Sorry for the bombarding of photos but I just want to post all the models/relationships involved
Plugin version
4.4.3.212
Operating system
MacOS
Steps to reproduce
No response
Relevant log output
No response