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
If you have two classes, say User and FeatureFlag and they have a relationship between them and that relationship specifies an extra column that is on the pivot, it is not recorded for the class when generating the models helper.
Example:
class FeatureFlag extends Model
{
public function users(): BelongsToMany
{
return $this->belongsToMany(User::class)
->withPivot('enabled')
->withTimestamps();
}
}
Versions:
Description:
If you have two classes, say User and FeatureFlag and they have a relationship between them and that relationship specifies an extra column that is on the pivot, it is not recorded for the class when generating the models helper.
Example:
Generated helper for model:
This leads to Phpstorm not suggesting and tools like Larastan complaining about not finding the fields.
Related issue in Larastan, larastan/larastan#1774
The text was updated successfully, but these errors were encountered: