/** * Add the threads receiver * @param Thread $thread * @param array $participants */ public function addReceiver(Thread $thread, array $participants) { if (count($participants)) { foreach ($participants as $user_id) { $thread->update(['receiver_id' => $user_id]); } } }