Minor fixes, coding standards

This commit is contained in:
Ludovic CANDELLIER
2021-11-01 00:50:10 +01:00
parent e356b3fcda
commit 8aaab4345f
47 changed files with 133 additions and 114 deletions

View File

@@ -40,16 +40,14 @@ class User extends parentUser
public function teams()
{
return $this->hasManyThrough(\App\Models\Core\Auth\Team::class, \App\Models\Core\Auth\TeamUser::class, 'user_id', 'id', 'id', 'team_id');
return $this->hasManyThrough(Team::class, TeamUser::class, 'user_id', 'id', 'id', 'team_id');
}
public function scopeByTeam($query, $id)
{
return $query->whereHas(
'teams', function ($query) use ($id) {
$query->where('id', $id);
}
);
return $query->whereHas('teams', function ($query) use ($id) {
$query->where('id', $id);
});
}
public function scopeByUniqueTeam($query)