[SOLVED] Adding users count to team in Vue
Hello,
How could I add to the teams property for my Vue components the number of users of each team?
Thank you in advance
Please share some code so that we can see how you are doing it
I got it, with:
Spark::swap('TeamRepository@forUser', function ($user) {
return $user->teams()->with('owner', 'users')->get();
});
If you mean the count of the users current team, it's already available to Vue: Spark.state.currentTeam.users.length
Thank you Cronix. I wanted it in the teams property, not in the current team.
Please or to participate in this conversation.