0
<input class="typeahead form-control" style="margin:0px auto;width:200px;" type="text">
</div>
<script type="text/javascript">
var path = "v1/versoes/autocompletesistema";
$('input.typeahead').typeahead({
source: function (query, process) {
return $.get(path, { query: query }, function (data) {
return process(data);
});
}
});
</script>
public function autocompletesistema( Request $request ){
$sistemas = Sistema::select("sistema as descricao", "id")
->where("sistema","LIKE","%{$request->input('query')}%")->get();
return response()->json($sistemas);
Boy, if you don’t detail what you’re up to and what you need, it’s hard for anyone to cooperate
– Marcos Xavier
The code is that there returns nothing
– guilherme.ramos
Guilherme, what version of the typeahead library are you using?
– Leonardo Getulio
@Guilherme.ramos understood this but when asking question in forum it is recommended to summarize as for example: - What you have done, what mistakes there were, if there were, which part is difficult etc
– Marcos Xavier