I managed to solve, follow the code in case someone is with this same problem:
$(document).ready(function () {
fetch_customer_data();
function fetch_customer_data(query = '')
{
$.ajax({
url:"{{ route('live_search.action') }}",
method:'GET',
data:{query:query},
dataType:'json',
success:function(data)
{
$('tbody').html(data.table_data);
$('#total_records').text(data.total_data);
}
});
}
$(document).on('keyup', '#search', function(){
var query = $(this).val();
fetch_customer_data(query);
});
});
In the controller simply calls:
$query = $request->get('query');
Summarizing in the ajax/jquery date parameter defines the method parameter in the controller. abç.
Can someone help me with this question please?
– Michel Diniz
It depends, because you will have to send a request via ajax to get the return of json. There are three native ways to work with javascript in the "depending on version" format, they are pure javascript "vanilla js", jquery and Vue.js
– Williams