title: saving multiple checkboxes values and save to the database using Laravel
body: <p>Hi i have this select checkbox which is the time when i check all the value does pass through it! Now my problem is when i saved into the database it is only one value saved. this is my HTML</p>
  
  <pre><code>&lt;p&gt;Sunday&lt;/p&gt;
                  &lt;input type="checkbox" name="select-all-sunday" id="select-all-sunday" onclick="toggle(this);"&gt; Check All
                  &lt;br&gt;
                  &lt;input type="checkbox" name="checkbox-sunday[]" id="checkbox-1" value="00:00"&gt; 00:00 &lt;br&gt;
                  &lt;input type="checkbox" name="checkbox-sunday[]" id="checkbox-2" value="1:00"&gt; 1:00 &lt;br&gt;
                  &lt;input type="checkbox" name="checkbox-sunday[]" id="checkbox-3" value="2:00"&gt; 2:00 &lt;br&gt;
                  &lt;input type="checkbox" name="checkbox-sunday[]" id="checkbox-4" value="3:00"&gt; 3:00 &lt;br&gt;
                  &lt;input type="checkbox" name="checkbox-sunday[]" id="checkbox-5" value="4:00"&gt; 4:00 &lt;br&gt;
                  &lt;input type="checkbox" name="checkbox-sunday[]" id="checkbox-6" value="5:00"&gt; 5:00 &lt;br&gt;
                  &lt;input type="checkbox" name="checkbox-sunday[]" id="checkbox-7" value="6:00"&gt; 6:00 &lt;br&gt;
                  &lt;input type="checkbox" name="checkbox-sunday[]" id="checkbox-8" value="7:00"&gt; 7:00 &lt;br&gt;
                  &lt;input type="checkbox" name="checkbox-sunday[]" id="checkbox-9" value="8:00"&gt; 8:00 &lt;br&gt;
                  &lt;input type="checkbox" name="checkbox-sunday[]" id="checkbox-10" value="9:00"&gt; 9:00 &lt;br&gt;
                  &lt;input type="checkbox" name="checkbox-sunday[]" id="checkbox-11" value="10:00"&gt; 10:00 &lt;br&gt;
                  &lt;input type="checkbox" name="checkbox-sunday[]" id="checkbox-12" value="11:00"&gt; 11:00 &lt;br&gt;
                  &lt;input type="checkbox" name="checkbox-sunday[]" id="checkbox-13" value="12:00"&gt; 12:00 &lt;br&gt;
                  &lt;input type="checkbox" name="checkbox-sunday[]" id="checkbox-14" value="13:00"&gt; 13:00 &lt;br&gt;
                  &lt;input type="checkbox" name="checkbox-sunday[]" id="checkbox-15" value="14:00"&gt; 14:00 &lt;br&gt;
                  &lt;input type="checkbox" name="checkbox-sunday[]" id="checkbox-16" value="15:00"&gt; 15:00 &lt;br&gt;
                  &lt;input type="checkbox" name="checkbox-sunday[]" id="checkbox-17" value="16:00"&gt; 16:00 &lt;br&gt;
                  &lt;input type="checkbox" name="checkbox-sunday[]" id="checkbox-18" value="17:00"&gt; 17:00 &lt;br&gt;
                  &lt;input type="checkbox" name="checkbox-sunday[]" id="checkbox-19" value="18:00"&gt; 18:00 &lt;br&gt;
                  &lt;input type="checkbox" name="checkbox-sunday[]" id="checkbox-20" value="19:00"&gt; 19:00 &lt;br&gt;
                  &lt;input type="checkbox" name="checkbox-sunday[]" id="checkbox-21" value="20:00"&gt; 20:00 &lt;br&gt;
                  &lt;input type="checkbox" name="checkbox-sunday[]" id="checkbox-22" value="21:00"&gt; 21:00 &lt;br&gt;
                  &lt;input type="checkbox" name="checkbox-sunday[]" id="checkbox-23" value="22:00"&gt; 22:00 &lt;br&gt;
                  &lt;input type="checkbox" name="checkbox-sunday[]" id="checkbox-24" value="23:00"&gt; 23:00 &lt;br&gt;
  </code></pre>
  
  <p>this is now my controller </p>
  
  <pre><code>$sundays = $request-&gt;input('checkbox-sunday');
  
          foreach($sundays as $sunday){
              echo  $sunday.",";
  
  
  
          }
  </code></pre>
  
  <p>Now the echo $sunday seems the value being passed from the form display correctly. Now upon saving into the database only one value is being saved.</p>
  
  <p>Below is my code upon saving to the database</p>
  
  <pre><code>$sundays = $request-&gt;input('checkbox-sunday');
  
          foreach($sundays as $sunday){
              echo  $sunday.",";
  
              $postRoom = PostRoom::find($id);
  
              $postRoom-&gt;description = $request-&gt;get('description');
              $postRoom-&gt;checkin_date = $request-&gt;get('bookingDate');
              $postRoom-&gt;checkin_time = $request-&gt;get('checkinTime');
              $postRoom-&gt;room_price = $request-&gt;get('roomPrice');
              $postRoom-&gt;day_sunday = $sunday;
              $postRoom-&gt;your_neighbourhood = $request-&gt;get('yourNeighbourhood');
  
              $postRoom-&gt;save();
  
              return redirect('add-your-listing/next-step-3/'.$postRoom-&gt;id);
  
  
  
          }
  </code></pre>
  
  <p>what is the best way to saved this one?. Can someone help me? TIA.</p>