title: how to get the specific data response from controller laravel
body: <p>I got confuse regarding getting the specific data value from response json in the controller of laravel. I have here sample which I get the response from controller.</p>
  
  <p><a href="https://i.stack.imgur.com/XA8MC.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XA8MC.jpg" alt="Response"></a></p>
  
  <p>when i try to get the customer_name the alert result is undefined, why it gives me undefined for that?</p>
  
  <p>I have here my ajax function:</p>
  
  <pre><code>$(function(){
              $("button#show_cart").click(function() {
                  var fired_button = $(this).val();
                  $('#customer_details').val(fired_button);
  
                  var details_id = $('#customer_details').val();
  
                  $.ajax({
                      url:'/customer_data_append',
                      type:'GET',
                      data:{customer_id: details_id},
                      success: function(response) {
  
                          alert(response.customer_name);
  
  
                      },
                       error: function(response) {
                          console.log(response);
                      }
                  });
  
              }); 
          });
  </code></pre>