title: Bootstrap Modal with foreach loop. How can pass the foreach argument?
body: <p>I'm working with PHP (Laravel 5.3) and developing a Blade view with a Bootstrap modal that have a foreach loop inside to show too many rows. This modal is called from a table that, in the end of every row have a button for more details (and this details are an array).</p>
  
  <p>So, how can I pass the array data to the modal?</p>
  
  <pre><code>&lt;div class="table-responsive"&gt;
      &lt;table class="table table-bordered m-table" id="business"&gt;
          &lt;thead class="columns"&gt;     
              &lt;tr&gt;
                  &lt;th class="column1"&gt;Name&lt;/th&gt;
                  &lt;th class="column2"&gt;Contact&lt;/th&gt;
                  &lt;th class="column3"&gt;Details&lt;/th&gt;
              &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody class="main-rows list" &gt;
              @foreach ($listBusiness as $business)
                  &lt;tr&gt;                                                        
                      &lt;td class="column1"&gt;{{$business-&gt;name}}&lt;/td&gt;
                      &lt;td class="column2"&gt;{{$business-&gt;contact}}&lt;/td&gt;
                      &lt;td class="column7"&gt;
                          &lt;a data-toggle="modal" data-target="#modalBusinessDetails"&gt;
                              &lt;i class="la la-search"&gt;&lt;/i&gt;
                          &lt;/a&gt;
                      &lt;/td&gt;                           
                  &lt;/tr&gt;
              @endforeach
          &lt;/tbody&gt;
      &lt;/table&gt;
  &lt;/div&gt;
  
  &lt;!-- Modal table --&gt;
  &lt;div class="modal" id="modalBusinessDetails" role="dialog"&gt;
      &lt;div class="modal-dialog"&gt;
          &lt;div class="modal-content"&gt;
              &lt;div class="modal-body text-center"&gt;
                  &lt;div class="col-12"&gt;                                
                      &lt;div class="table-responsive"&gt;
                          &lt;table class="table table-bordered m-table" id="business"&gt;
                              &lt;thead class="columns"&gt;     
                                  &lt;tr&gt;
                                      &lt;th class="column1"&gt;Created at&lt;/th&gt;
                                      &lt;th class="column2"&gt;Active&lt;/th&gt;
                                      &lt;th class="column2"&gt;Employees&lt;/th&gt;
                                  &lt;/tr&gt;
                              &lt;/thead&gt;
                              &lt;tbody class="main-rows"&gt;
                                  @foreach ($ListDetail as $BusinessDetail)
                                      &lt;tr&gt;
                                          &lt;td class="column1"&gt;{{$BusinessDetail-&gt;created_at}}&lt;/td&gt;
                                          &lt;td class="column2"&gt;{{$BusinessDetail-&gt;active}}&lt;/td&gt;
                                          &lt;td class="column3 text-center"&gt;{{$BusinessDetail-&gt;employees}}&lt;/td&gt;
                                      &lt;/tr&gt;
                                  @endforeach
                              &lt;/tbody&gt;
                          &lt;/table&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="btn group"&gt;
                      &lt;button type="button" data-dismiss="modal"&gt;{{Tr('Close')}}&lt;/button&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>