opened
jrleonr
username_0
In the MessageControllers we have this:

```php
// show current user in list if not a current participant
// $users = User::whereNotIn('id', $thread->participantsUserIds())->get();

// don't show the current user in list
$userId = Auth::user()->id;
$users = User::whereNotIn('id', $thread->participantsUserIds($userId))->get();
```

That will show all the users in the database except those on the participants table. This confuse me a bit. How do you don't show yourself in the participants list, if when you send your id, it's added twice. Something is not completely right but don't know what!! is the example not updated or the code itself?

Thanks!
Removing and showing participants list
issue
created
cmgmyr
username_1
Hi @username_0,
If you take a look at the `update` method on the controller you'll see:

```php
$participant = Participant::firstOrCreate(
    [
        'thread_id' => $thread->id,
        'user_id'   => Auth::user()->id,
    ]
);
$participant->last_read = new Carbon;
$participant->save();
```

The `firstOrCreate` will just grab the current user as a participant, if the current user is a new participant, then it will get added. It will not be duplicated in the database. Make sense? Feel free to reply to this thread if you have any more questions.
comment
closed
cmgmyr
username_1
issue