title: passing a complete loop to bootstrap modal
body: <p>I want to edit multi select for which i want to pass two loops to 
     bootstrap modal and their i want to compare id's and on that basis i will select already selected record my button</p>
  
  <pre><code>&lt;a type="button" data-toggle="modal" data-target="#editModal{{ $value-&gt;id}}"&gt;
    &lt;span class="glyphicon glyphicon-edit"&gt;&lt;/span&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>my form</p>
  
  <pre><code>&lt;div class="form-group"&gt;
  
      &lt;select name="upsubject[]" multiple class="form-control"&gt;
  
       @foreach($subject as $data)
  
            @foreach($value-&gt;subject as $key)
  
                &lt;option value="{{$data-&gt;id}}" &lt;?php if ($key-&gt;id == $data-&gt;id)
  
  {echo 
  
  "selected";}
  
  ?&gt;&gt;{{$data-&gt;name}}&lt;/option&gt;
  
              @endforeach
  
          @endforeach
  
      &lt;/select&gt;
  &lt;/div&gt;`
  </code></pre>