public function autocomplete(
        $name,
        $list = [],
        $selected = [],
        array $inputAttributes = [],
        array $spanAttributes = [],
        $inputOnly = false
    ) {
        // Forces the ID attribute
        $inputAttributes['id'] = $name.'-ms';
        if (!isset($inputAttributes['class'])) {
            $inputAttributes['class'] = 'multiselect';
        }

        // We will concatenate the span html unless $selectOnly is passed as false
        $spanHtml = $inputOnly ? '' : $this->span($name, $list, $selected, $spanAttributes);

        $inputAttributes = $this->attributes($inputAttributes);

        return $this->toHtmlString($spanHtml."<input type=\"text\"{$inputAttributes}>");
    }
public function autocomplete(
        $name,
        $list = [],
        $selected = [],
        array $inputAttributes = [],
        array $spanAttributes = [],
        $inputOnly = false
    ) {
        // Forces the ID attribute
        $inputAttributes['id'] = $name.'-ms';
        if (!isset($inputAttributes['class'])) {
            $inputAttributes['class'] = 'multiselect';
        }

        // We will concatenate the span html unless $selectOnly is passed as false
        $spanHtml = $inputOnly ? '' : $this->span($name, $list, $selected, $spanAttributes);

        $inputAttributes = $this->attributes($inputAttributes);

        return $this->toHtmlString($spanHtml."<input type=\"text\"{$inputAttributes}>");
    }
public function autocomplete ( $ name , $ list = [ ] , $ selected = [ ] , array $ inputAttributes = [ ] , array $ spanAttributes = [ ] , $ inputOnly = false ) { // Forces the ID attribute $ inputAttributes [ 'id' ] = $ name . '-ms' ; if ( ! isset ( $ inputAttributes [ 'class' ] ) ) { $ inputAttributes [ 'class' ] = 'multiselect' ; } // We will concatenate the span html unless $selectOnly is passed as false $ spanHtml = $ inputOnly ? '' : $ this -> span ( $ name , $ list , $ selected , $ spanAttributes ) ; $ inputAttributes = $ this -> attributes ( $ inputAttributes ) ; return $ this -> toHtmlString ( $ spanHtml . "<input type=\"text\"{$inputAttributes}>" ) ; }
Create the multi-select autocomplete field and optionally the already selected span field.
This method interface mimicks LaravelCollective\html select method.

@param string $name            The name of the select element. Will be used by the JS to add hidden inputs
@param array  $list            A Laravel collection or list of key => values
@param array  $selected        A laravel collection or list of keys
@param array  $inputAttributes
@param array  $spanAttributes
@param bool   $inputOnly

@return \Illuminate\Support\HtmlString
Create the multi - select autocomplete field and optionally the already selected span field . This method interface mimicks LaravelCollective \ html select method .