mpociot / teamwork

User to Team associations with invitation system for the Laravel 5 Framework
MIT License
1.07k stars 170 forks source link

TeamworkTeamTrait owner() method should be a BelongsTo relationship #99

Closed spriggsey closed 4 years ago

spriggsey commented 6 years ago

Currently the relationship of the Team model is using the incorrect join.

The owner() relationship on the Team model should be a belongsTo() relationship as the Team model has the owner_id column.

The original code does work but with implementation of Laravel Nova it becomes an issue as they require a BelongsTo join to properly function.

https://github.com/mpociot/teamwork/blob/4de34f53c44757030ed54dde5f69fe48b7a207e1/src/Mpociot/Teamwork/Traits/TeamworkTeamTrait.php#L35-L46

okaufmann commented 4 years ago

This should be fixed now.