Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

array value auto fill in old value laravel 8

<select name="options[]" id="options" class="form-control" multiple>
    @foreach($settings->includes->get('optionList') as $option)
        <option value="{{ $option->id }}" {{ (collect(old('options'))->contains($option->id)) ? 'selected':'' }}>{{ $option->name }}</option>
    @endforeach
</select>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #array #auto #fill #laravel
ADD COMMENT
Topic
Name
4+4 =