Open brendt opened 3 years ago
Does this also apply if you do not use _ide_helper_models.php (i.e. remove it) and just write the metadata into the models?
No, but we really need the mixin approach.
but we really need the mixin approach.
May I inquire as to why?
Because mixins prevent the duplicate class issue, and because we use class doc comments for other stuff as well, so we can't override them every time we generate new model meta data.
I can confirm this bug still exists. @brendt Did you find any kind of workaround or fix?
I've generated model IDE helper mixins using
ide-helper:models -M
.One example of a model is this:
Looking in the
_ide_helper_models.php
file,IdeHelperDegreeType
looks like this:All looks good up until this point, however, both PhpStorm and Psalm report errors on
DegreeType::query()->whereName("B.A./B.S.")->first()
, they don't know thatquery()
can return aDegreeType
model. In fact, if I "go to definition" on the query method, PhpStorm sends me to Laravel's Model class, and not the mixin file. This makes me believe that either the mixin file isn't recognised, or that Laravel's code somehow gets precedence over the mixin file.Any ideas?