title: Print php`s object data in specific order
body: <pre><code>&lt;?php $days = ['sun','mon','tue','wed','thur','fri','sat'];?&gt;
  
                      @for($i=0;$i&lt;count($days);$i++)
  
                          &lt;label&gt;{{$days[$i]}}:&lt;/label&gt;
  
                          @for($j=0;$j&lt;2;$j++)
  
                              &lt;div class="form-group"&gt;
                                  &lt;label&gt;From:&lt;/label&gt;
                                  &lt;input class="form-control" name="{{$days[$i]}}[{{$j}}][start]" type="text" value=""&gt;
                                  &lt;label&gt;To:&lt;/label&gt;
                                  &lt;input class="form-control" name="{{$days[$i]}}[{{$j}}][end]" type="text" value=""&gt;
                              &lt;/div&gt;
  
                          @endfor
  
                      @endfor
  </code></pre>
  
  <p>The above code prints html form from sunday to saturday with 4 input fields for each days:
  <img src="https://i.stack.imgur.com/MlRmO.png" alt="htmlform"></p>
  
  <p>I have passed a collection object from the controller to the view with $data as a variable name. So in the $data variable I have the fetched rows from databased which matched the selection.
  I want to be able to print the fetched values in the input fields.
  For eg: For sunday i want to only print the value belonging to sunday in the input field and so forth.And in the database the value of day is simply 1 for sunday to 7 for saturday.Here is the output of $data:</p>
  
  <p><img src="https://i.stack.imgur.com/Jtb99.png" alt="enter image description here"></p>