Add autocomplete #2457

This commit is contained in:
James Cole
2019-08-22 19:07:01 +02:00
parent effba42ac2
commit a2be71499f
4 changed files with 59605 additions and 88 deletions

View File

@@ -176,13 +176,7 @@ class AutoCompleteController extends Controller
$filtered = $result->unique('description');
$limited = $filtered->slice(0, 15);
$array = $limited->toArray();
foreach ($array as $index => $item) {
// give another key for consistency
$array[$index]['name'] = $item['description'];
}
return response()->json($array);
return response()->json(array_values($array));
}
/**