title: sending one composed text to emails saved in database using laravel
body: <p>I have created a form, upon its submission it goes to email id which is stored in Laravels mail function. But I want to send same email to multiple people whose email-id are stored in database. Here is my code:</p>
  
  <p>Routes:</p>
  
  <pre><code>Route::get('contactform', 'ClientsController@display1');
  Route::post('contactform', 'ClientsController@contact');
  </code></pre>
  
  <p>My controller:  </p>
  
  <pre><code>public function display(){
      $data = Input::get('agree');
      $count = count ($data);
      if($count){
          return $this-&gt;contact( $data,$count);
      }
      else{
          echo "Select At least one email-id.";
          return view('clientinfo.backtoprev');
      }
  
  }
  
      public function display1(){
  
          return view('contactform');
      }
  
      public function contact($data,$count){
          $input = Input::only('name', 'email', 'msg');
  
          $validator = Validator::make($input,
              array(
                  'name' =&gt; 'required',
                  'email' =&gt; 'required|email',
                  'msg' =&gt; 'required',
              )
          );
  
          if ($validator-&gt;fails())
          {
              return Redirect::to('contact')-&gt;with('errors', $validator-&gt;messages());
          } else { 
  
  
              Mail::send('contactemail', $input, function($message) use($data)
              {
                  $message-&gt;from('your@email.address', 'Your Name');
  
                  $message-&gt;to( $data);
              });
  
              return view('clientinfo.display', compact('data','count'));
          }
  
      }
  </code></pre>
  
  <p>here is my view "Contactform"</p>
  
  <pre><code>{!! Form::open(array('action' =&gt; 'ClientsController@contact','method' =&gt; 'post','name'=&gt;'f1' , 'id'=&gt;'form_id'))!!}  
      @if(Session::has('errors'))
          &lt;div class="alert alert-warning"&gt;
              @foreach(Session::get('errors')-&gt;all() as $error_message)
                  &lt;p&gt;{{ $error_message }}&lt;/p&gt;
              @endforeach
          &lt;/div&gt;
      @endif
         //My fields, name &amp; message
  {!! Form::close() !!}
  </code></pre>
  
  <p>From the "display" method i'm passing two variables $data and $count to contact method, but after filling form and hitting submit error comes as</p>
  
  <p><strong>Missing argument 1 for App\Http\Controllers\ClientsController::contact()</strong></p>