club_user (id, club_id, user_id, role). Role can be 'member', 'trainer', 'staff'').
in my User model I have an belongsToMany relation
public function clubs(): BelongsToMany
{
return $this->BelongsToMany(Club::class);
}
Some functionality is reserved to non-members. I'm trying to write an Eloquent query to check if the current user is trainer of staff for at least one of its clubs. I'm trying something like the code below (and some variants) but this return ALL users who have clubs with non-member roles. Not just for the current user. What am I missing here?