original_string: public function show($id)
      {
          try {
              $thread = Thread::findOrFail($id);
          } catch (ModelNotFoundException $e) {
              Session::flash('error_message', 'The thread with ID: ' . $id . ' was not found.');
  
              return redirect('message');
          }
  
          // 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();
  
          $thread->markAsRead($userId);
  
          return view('chat.show', compact('thread', 'users'));
      }
code: public function show($id)
      {
          try {
              $thread = Thread::findOrFail($id);
          } catch (ModelNotFoundException $e) {
              Session::flash('error_message', 'The thread with ID: ' . $id . ' was not found.');
  
              return redirect('message');
          }
  
          // 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();
  
          $thread->markAsRead($userId);
  
          return view('chat.show', compact('thread', 'users'));
      }
code_tokens: public function show ( $ id ) { try { $ thread = Thread :: findOrFail ( $ id ) ; } catch ( ModelNotFoundException $ e ) { Session :: flash ( 'error_message' , 'The thread with ID: ' . $ id . ' was not found.' ) ; return redirect ( 'message' ) ; } // 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 ( ) ; $ thread -> markAsRead ( $ userId ) ; return view ( 'chat.show' , compact ( 'thread' , 'users' ) ) ; }
docstring: Shows a message thread
  
  @param $id
  @return mixed
docstring_tokens: Shows a message thread