You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently writing the PHPDocs to a few models and I noticed the wrong doc was being generated for the BelongsTo relation (and possibly other relations that return single models):
A developer added this to prevent the model helper file generator from failing when using the Compoships package...however, this broke the types for the BelongsTo relation.
Versions:
Description:
Hello!
I'm currently writing the PHPDocs to a few models and I noticed the wrong doc was being generated for the
BelongsTo
relation (and possibly other relations that return single models):/** @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\User> $createdByUser */
However, a
BelongsTo
relation never returns a collection so this instead should be:/** @property-read null|\App\Models\User $createdByUser */
This is causing PHPStan Level 2 to fail with:
when trying to call
$model->createdByUser->name
Steps To Reproduce:
BelongsTo
relation definedThanks!
The text was updated successfully, but these errors were encountered: