poma's avatar
Level 1

How to enable autocomplete for Laravel Resources in PhpStorm?

Laravel 5.5 has a new API Resources feature, and it nicely redirects calls to model attributes (like $this->id). I use ide-helper:models to generate phpdocs for models that type-hints all model attributes. However, this does not apply to a resource and I get "Field accessed via magic method" squigglies. Is there a way to point it to model's phpdoc without copying it?

0 likes
2 replies
poma's avatar
poma
OP
Best Answer
Level 1

Found the solution. Add @mixin <model> to Resource class phpdoc

3 likes

Please or to participate in this conversation.