Show users who are not in team
Hi, i'm trying to create a form which can be used to add members to a team.
I'm using a repeater to manage existing users using the following code:
Forms\Components\Repeater::make('teamUsers')
->relationship()
->simple(
Forms\Components\Select::make('user_id')
->placeholder('Select a user')
->relationship(
'user',
'name',
modifyQueryUsing: function (Builder $query) {}
)
->required()
->searchable(),
),
I'm using a repeater on TeamUser (pivot).
How can i only show users who are not in the team already?2 Replies