Replies: 1 comment
-
Hey there, We're closing this issue because it's inactive, already solved, old, or not relevant anymore. Feel free to open up a new issue if you're still experiencing this problem. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This would be a non-breaking change and would touch a single class:
Illuminate\Database\Eloquent\Factories\Factory
There is currently no way for PHPStorm to know which precise model class would be returned by a call such as:
$model = MyModel::factory()->create()
As of now, PHPStorm would typehint the $model variable as either a
Collection
or aModel
.I propose to add the required
@template
phpdocs to the Factory class so that we can get proper typehinting in the IDEs and help static analysis tools to catch errors. In the above example, PHPStorm would know that$model
is of theMyModel
class if we define our factory with a phpdoc on top:Beta Was this translation helpful? Give feedback.
All reactions