original_string: public function store()
      {
          $input = Input::all();
  
          $thread = Thread::create(
              [
                  'subject' => $input['subject'],
              ]
          );
  
          // Message
          Message::create(
              [
                  'thread_id' => $thread->id,
                  'user_id'   => Auth::user()->id,
                  'body'      => $input['message'],
              ]
          );
  
          // Sender
          Participant::create(
              [
                  'thread_id' => $thread->id,
                  'user_id'   => Auth::user()->id,
                  'last_read' => new Carbon
              ]
          );
  
          // Recipients
          if (Input::has('recipients')) {
              $thread->addParticipants($input['recipients']);
          }
  
          return redirect('message');
      }
code: public function store()
      {
          $input = Input::all();
  
          $thread = Thread::create(
              [
                  'subject' => $input['subject'],
              ]
          );
  
          // Message
          Message::create(
              [
                  'thread_id' => $thread->id,
                  'user_id'   => Auth::user()->id,
                  'body'      => $input['message'],
              ]
          );
  
          // Sender
          Participant::create(
              [
                  'thread_id' => $thread->id,
                  'user_id'   => Auth::user()->id,
                  'last_read' => new Carbon
              ]
          );
  
          // Recipients
          if (Input::has('recipients')) {
              $thread->addParticipants($input['recipients']);
          }
  
          return redirect('message');
      }
code_tokens: public function store ( ) { $ input = Input :: all ( ) ; $ thread = Thread :: create ( [ 'subject' => $ input [ 'subject' ] , ] ) ; // Message Message :: create ( [ 'thread_id' => $ thread -> id , 'user_id' => Auth :: user ( ) -> id , 'body' => $ input [ 'message' ] , ] ) ; // Sender Participant :: create ( [ 'thread_id' => $ thread -> id , 'user_id' => Auth :: user ( ) -> id , 'last_read' => new Carbon ] ) ; // Recipients if ( Input :: has ( 'recipients' ) ) { $ thread -> addParticipants ( $ input [ 'recipients' ] ) ; } return redirect ( 'message' ) ; }
docstring: Stores a new message thread
  
  @return mixed
docstring_tokens: Stores a new message thread