Category: Laravel, PHP
With that bunch of logic behind the scenes, it’s normal for an IDE to just not understand what’s going on.
When the IDE is not “intelligent enough” to understand what happens behind methods like __call() and __get(), we end up with no code assistance.
This declarations allows PHPStorm (my favorite) and other IDE to understand that magic, at least in an acceptable state.
Opening with query() will allow your IDE to also mix in your local scopes since we also set it to return the model.
If your model is using timestamps, it’s nice to also add them in the PHPDoc, specially if you work with them constantly.