title: Dynamically add dropdown box in laravel. Javascript and laravel
body: <p>I want to add dynamic dropdown &amp; textbox. But for textbox is ok. I am not ok  in dropdown. The Data are not include in Dropdown.I am loop to retrieve data in blade.I am describe my code.</p>
  
  <p>form.blade.php<br></p>
  
  <pre><code> &lt;div class="form-group"&gt;
                  &lt;label for="type"&gt;Gas Container Type&lt;/label&gt;
                  &lt;select class="form-control input-sm" name="gas" id="gas"&gt;
                      @foreach($gass as $gas)
                          &lt;option value="{{$gas-&gt;name}}"&gt;{{$gas-&gt;name}}&lt;/option&gt;
                      @endforeach
  
  
                  &lt;/select&gt;&lt;!-- end of Item_Drop_Down --&gt;
              &lt;/div&gt;
              &lt;input name="name[]" type="text" id="name" class="name" placeholder="Input 1"&gt;
              &lt;a href="#" id="add"&gt;Add More Input Field&lt;/a&gt;
  </code></pre>
  
  <p>master.blade.php</p>
  
  <pre><code>&lt;script&gt;
  
  $(document).ready(function () {
      var e = document.getElementById("gas");
  
      $('#add').click(function () {
  
          var inp = $('#box');
  
          var i = $('input').size() + 1;
  
          $('&lt;div id="box' + i + '"&gt;' + '' +
                  '&lt;input type="text" id="name" class="name" name="name[]" placeholder="Input ' + i + '"/&gt;' + '' +
                  '&lt;select id="gas"  name="gas[]" ' + i + '"/&gt;&lt;img src="remove.png" width="32" height="32" border="0" align="top" class="add" id="remove" /&gt; &lt;/div&gt;')
                  .appendTo($('#box form'));
  
          i++;
  
      });
  
      {{--&lt;select data-bind="options: availableCountries, optionsText: 'name', optionsValue: 'value'"&gt;&lt;/select&gt;--}}
  
      $('body').on('click', '#remove', function () {
  
          $(this).parent('div').remove();
  
  
      });
  
  
  });
  </code></pre>
  
  <p></p>
  
  <p>controller.php</p>
  
  <pre><code>public function store(Request $request)
  {
  
      foreach ($request-&gt;get('name') as $name) {
          $kg = new WarehouseGasIn();
          $kg-&gt;kg = $name;
          //dd($request-&gt;get('name'));
          $kg-&gt;save();
  
      }
  </code></pre>