title: How to Pass value to Bootstrap model in laravel?
body: <p>I am trying to pass a value to the bootstrap model, but for each of the rows the edit button only displays the last row id. How can I display the edit button on each of the rows?</p>
  
  <p>Here is a sample of my code:</p>
  
  <pre><code>@foreach($data as $cat_values)
        &lt;tr&gt;
          &lt;td&gt;&lt;input type="checkbox" class="checkthis" /&gt;&lt;/td&gt;
          &lt;td&gt;{{$cat_values-&gt;cat_name}}&lt;/td&gt;
  
            &lt;td&gt;{{$cat_values-&gt;cat_desc}}&lt;/td&gt;
          &lt;td&gt;{{$cat_values-&gt;cat_slug}}&lt;/td&gt;
  
            &lt;td&gt;{{$cat_values-&gt;created_at}}&lt;/td&gt;
              &lt;td&gt;{{$cat_values-&gt;updated_at}}&lt;/td&gt;
  
          &lt;td&gt;&lt;p  data-id="{{$cat_values-&gt;id}}" data-placement="top" data-toggle="tooltip" title="Edit"&gt;
          &lt;button data-id="{{$cat_values-&gt;id}}" class="btn btn-primary btn-xs edit-page" data-title="Edit" data-toggle="modal" data-target="#edit" &gt;
          &lt;span class="glyphicon glyphicon-pencil"&gt;&lt;/span&gt;&lt;/button&gt;&lt;/p&gt;&lt;/td&gt;
          &lt;td&gt;&lt;p  data-id="{{$cat_values-&gt;id}}" data-placement="top" data-toggle="tooltip" title="Delete"&gt;&lt;button class="btn btn-danger btn-xs edit-page" data-title="Delete" data-toggle="modal" data-target="#delete" &gt;&lt;span class="glyphicon glyphicon-trash"&gt;&lt;/span&gt;&lt;/button&gt;&lt;/p&gt;&lt;/td&gt;
             &lt;td&gt;&lt;p data-placement="top" data-toggle="tooltip" title="Delete"&gt;&lt;button class="btn btn-danger btn-xs" data-title="Delete" data-toggle="modal" data-target="#delete" &gt;&lt;span class="glyphicon glyphicon-trash"&gt;&lt;/span&gt;&lt;/button&gt;&lt;/p&gt;&lt;/td&gt;
      &lt;/tr&gt;
    @endforeach;
  </code></pre>
  
  <p>And here is the model:</p>
  
  <pre><code>&lt;div class="modal fade" id="edit" tabindex="-1" role="dialog" aria-labelledby="edit" aria-hidden="true"&gt;
        &lt;div class="modal-dialog"&gt;
      &lt;div class="modal-content"&gt;
            &lt;div class="modal-header"&gt;
          &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;
          &lt;span class="glyphicon glyphicon-remove" aria-hidden="true"&gt;&lt;/span&gt;
          &lt;/button&gt;
          &lt;h4 class="modal-title custom_align" id="Heading"&gt;Edit Your Detail&lt;/h4&gt;
        &lt;/div&gt;
            &lt;div class="modal-body"&gt;
            &lt;div class="form-group"&gt;
              &lt;input type="text" id="id" name="id" value="" /&gt;
          &lt;input class="form-control " type="text" placeholder="" value="{{$cat_values-&gt;cat_name}}"&gt;
          &lt;/div&gt;
          &lt;div class="form-group"&gt;
  
          &lt;input class="form-control " type="text" placeholder="" value="{{$cat_values-&gt;parent_cat}}"&gt;
          &lt;/div&gt;
          &lt;div class="form-group"&gt;
          &lt;textarea rows="2" class="form-control" placeholder="" value=""&gt;{{$cat_values-&gt;parent_cat}}&lt;/textarea&gt;
  
  
          &lt;/div&gt;
           &lt;div class="form-group"&gt;
  
          &lt;input class="form-control " type="text" placeholder="" value="{{$cat_values-&gt;cat_desc}}"&gt;
          &lt;/div&gt;
           &lt;div class="form-group"&gt;
  
          &lt;input class="form-control " type="text" placeholder="" value="{{$cat_values-&gt;cat_slug}}"&gt;
          &lt;/div&gt;
        &lt;/div&gt;
            &lt;div class="modal-footer "&gt;
          &lt;button type="button" class="btn btn-warning btn-lg" style="width: 100%;"&gt;&lt;span class="glyphicon glyphicon-ok-sign"&gt;&lt;/span&gt; Update&lt;/button&gt;
        &lt;/div&gt;
          &lt;/div&gt;
      &lt;!-- /.modal-content --&gt; 
    &lt;/div&gt;
        &lt;!-- /.modal-dialog --&gt; 
      &lt;/div&gt;
  </code></pre>
  
  <p>How i can pass value to bootstrap model in Laravel? Thank you.</p>
  
  <p><strong>Updated:</strong></p>
  
  <pre><code> public function viewCategory()
      {
  
          $retrive=Category::all();
          $data=['data'=&gt;$retrive];
          return view('a.view_category',$data);
  
      }
  </code></pre>
  
  <p>and in view if i print data </p>
  
  <pre><code>@foreach($data as $value)
  {{$value-&gt;id;}}
  {{$value-&gt;cat_name}}
  {{$value-&gt;cat_desc}}
  {{$value-&gt;cat_slug}}
  @endforeach
  </code></pre>