public function addParticipants(array $participants)
    {
        if (count($participants)) {
            foreach ($participants as $user_id) {
                Participant::firstOrCreate([
                    'user_id' => $user_id,
                    'thread_id' => $this->id,
                ]);
            }
        }
    }
public function addParticipants(array $participants)
    {
        if (count($participants)) {
            foreach ($participants as $user_id) {
                Participant::firstOrCreate([
                    'user_id' => $user_id,
                    'thread_id' => $this->id,
                ]);
            }
        }
    }
public function addParticipants ( array $ participants ) { if ( count ( $ participants ) ) { foreach ( $ participants as $ user_id ) { Participant :: firstOrCreate ( [ 'user_id' => $ user_id , 'thread_id' => $ this -> id , ] ) ; } } }
Adds users to this thread

@param array $participants list of all participants
@return void
Adds users to this thread