title: Laravel Pass Old or value to modal
body: <p>Seems like Modal is not very easy to implement on large scales, I want to find an alternative way to pass values to the modal in order to display it properly.</p>
  <p>In the blow example, I'm populating the &quot;name&quot; field from the dataTable itself, this works great but what if I want to pass for example</p>
  <pre><code>old('name') ?? $document-&gt;name
  </code></pre>
  <p>How would I be able to accomplish this on a large scale, say a 10+ fields entry?</p>
  <p><strong>Button</strong></p>
  <pre><code>&lt;a href=&quot;#&quot;&gt;&lt;i class=&quot;bx bxs-edit text-primary bx-sm edit&quot; title=&quot;Edit Document&quot;&gt;&lt;/i&gt;&lt;/a&gt;
  </code></pre>
  <p><strong>Script</strong></p>
  <pre><code>&lt;script type=&quot;text/javascript&quot;&gt;
  $(document).ready( function () {
      var table = $('#indextable').DataTable();
      
      //Edit Record
      table.on('click', '.edit', function(){
         $tr = $(this).closest('tr');
         if ($($tr).hasClass('child')){
             $tr = $tr.prev('.parent');
         }
          //Config Table
          var data = table.row($tr).data();
          $('#name').val(data[1]);
          
          $('#editForm').attr('action', '/virtual/documents/'+data[0]);
          $('#editModal').modal('show');
      });
      
      $(&quot;#editForm&quot;).submit(function () {
          $(&quot;.submit&quot;).attr(&quot;disabled&quot;, true);
              return true;
      });
  });
  
  @if (count($errors) &gt; 0)
      $('#editModal').modal('show');
  @endif
  &lt;/script&gt;
  </code></pre>