src/Repositories/Repository.php
public function autocomplete($text)
    {
        if (! $this->builder) {
            $this->builder = $this->model;
        }
        
        $fields = $this->model->getAutocomplete();
        
        foreach ($fields as $field) {
            
            $this->builder = $this->builder->where(function ($query) use ($field, $text) {
                $query->orWhere($field, 'like', "%$text%");
            });
        }
        
        return $this;
    }
public function autocomplete($text)
    {
        if (! $this->builder) {
            $this->builder = $this->model;
        }
        
        $fields = $this->model->getAutocomplete();
        
        foreach ($fields as $field) {
            
            $this->builder = $this->builder->where(function ($query) use ($field, $text) {
                $query->orWhere($field, 'like', "%$text%");
            });
        }
        
        return $this;
    }
Autocomplete

@return array;