W template.blade.php jest podpięte jquery na dole
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
</body>
</html>
a w view translations/ list.blade.php mam kod js podpięty na dole
@extends('template')
@section('title')
@if (isset ($title))
{{ $title }}
@endif
@endsection
@section('content')
{{-- LIST --}}
<div class="container tables">
{{-- Search input --}}
<div class="panel panel-default">
<div class="panel-body">
<div class="form-group">
<input type="text" name="search"onclick="myFunction()" id="search" class="form-control" placeholder="Search your translations " />
</div>
<div class="table-responsive">
<h3>Total Data : <span id="total_records"></span></h3>
{{-------------------------- Search input ----------------------------------------------}}
<div class="container tables">
<h1 class="text-left">Possible Translations</h1>
<table class="table table-hover">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Translation</th>
</tr>
</thead>
<tbody>
@foreach($translations as $translation)
<tr>
<th scope="row">{{ $translation->id }}</a></th>
<th><a href="{{ URL::to('translations/' . $translation->id ) }}"> {{ $translation->name }}</th>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
{{-- end list --}}
<script>
$(document).ready(function(){
fetch_customer_data();
function fetch_customer_data(query = '')
{
$.ajax({
url:"{{ route('translations.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);
});
});
</script>
@endsection('content')
Skąd więc ten błąd? Wszystko sprawia że wyszukiwanie nie działa.