title: Laravel How to append Ajax json in Select option
body: <p>what is issue with my code, it returns empty drop down. i want drop down of nationality table, in teachers profile.</p>
  
  <p><strong>View:</strong></p>
  
  <pre><code>&lt;select class="form-control" name="nation_id" id="nation_id"&gt;
       &lt;input type="hidden" name="teacher_nation_id" id="teacher_nation_id" 
        value="{{ @$teacher-&gt;nation_id}}"&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>ajax code which returns empty dropdown: <strong>Ajax:</strong></p>
  
  <pre><code> &lt;script&gt;
      $(document).ready(function($){
          $.get('nations-list', function(data) {
              let teacher_nation_id = $('#teacher_nation_id').val();
              let nations = $('#nation_id');
              nations.empty();
  
              $.each(data, function(key, value) {
                  nations.append("&lt;option value='"+ key +"'&gt;" + value + "&lt;/option&gt;");
              });
  
              nations.val(teacher_nation_id); 
          });
      });
      &lt;/script&gt;
  </code></pre>
  
  <p>My <strong>Controller:</strong></p>
  
  <pre><code>public function ajaxrequest(Request $request)
  {
  
    $nations = Nation::all()-&gt;pluck('nation', 'id');
  
      return response()-&gt;json($nations);
  }
  </code></pre>
  
  <p>Here is my route:
  <strong>Route:</strong></p>
  
  <pre><code>Route::get('nations-list','TeachersController@ajaxrequest');
  </code></pre>