input('term')) return []; $result = collect(); $uo = Auth::user(); # Look for Account foreach (Account::Search($request->input('term')) ->whereIN('id',$uo->all_clients()->pluck('id')) ->orderBy('company') ->orderBy('last_name') ->orderBy('first_name') ->limit(10)->get() as $o) { $result->push(['label'=>sprintf('A:%s %s',$o->aid,$o->name),'value'=>'/u/account/'.$o->id]); } return $result; } }