title: How to store array in Laravel?
body: <p>There are two mysql tables 1.seats (id,number), 2.reservedseats(id,seat_id,sceering_id).
  I show all the seats of a specific sceering as checkboxes in show.blade:</p>
  
  <pre><code>{!!Form::model($screening,['method'=&gt;'post', 'action'=&gt; 
  ['ReserveController@store',$screening-&gt;auditorium-&gt;id]])!!}
  
  &lt;input type="hidden" name="screening_id" value="{{$screening-&gt;id}}"&gt;
  
  @foreach($seats as $seat)
  
  &lt;label class="checkbox-inline"&gt;
  
  {!!Form::checkbox('seat_id[]',$seat-&gt;id,null)!!} Number: {{$seat-&gt;number}}  
  
  &lt;/label&gt;
  
  @endforeach
  
  &lt;div class='form-group'&gt;
  
  {!!Form::submit('Create Post',['class'=&gt;'btn btn-primary '])!!}
  
  &lt;/div&gt;
  
  {!!Form::close()!!}
  </code></pre>
  
  <p>When I click a checkbox it goes the the seat_id[] array. So I send a hidden input and an array with the seat_ids then I want to store in the reservedseats Mysql table. But in the store controller I have the problem. I'm trying something like:</p>
  
  <pre><code>public function store(Request $request){
  
   $screening_id = $request-&gt;screening_id;
  
   $seat_ids = $request-&gt;seat_id;
  
    foreach($seat_ids as $seat_id){
  
      Seatreserved::create($seat_id,$screening_id);
  
     }
  }
  </code></pre>
  
  <p>So it not working but how can I solve that?</p>