public function filterBySearchTerm($term, EloquentBuilder &$query, Field $fieldObject, array $selectedItems, $relatedKeyTable)
    {
        if ($term) {
            $query->where(function ($query) use ($term, $fieldObject) {
                foreach ($fieldObject->getOption('search_fields') as $search) {
                    $query->orWhere($this->db->raw($search), 'LIKE', '%'.$term.'%');
                }
            });

            //exclude the currently-selected items if there are any
            if (count($selectedItems)) {
                $query->whereNotIn($relatedKeyTable, $selectedItems);
            }

            //set up the limits
            $query->take($fieldObject->getOption('num_options') + count($selectedItems));
        }
    }