PHP
array value auto fill in old value laravel 8
<label for="name">Tags</label>
<select name="tags[]" class="form-control select-tag" multiple>
@foreach($tags as $tag)
<option value="{{$tag->id}}" {{in_array($tag->id, old("tags") ?: []) ? "selected": ""}}>{{$tag->name}}</option>
@endforeach
</select>
array value auto fill in old value laravel 8
<select id="recommended_food" multiple="multiple" size=3 style='height: 100%;' name="recommended_food[]">
@if ($food->recomemded_food)
{{ ($val = 'Fries')
&& $chosen = in_array($val, $food->recommended_food)
? 'selected':null}}
<option value="{{$val}}" {{$chosen}}>{{$val}}</option>
{{ ($val = 'Hot Dogs')
&& $chosen = in_array($val, $food->recommended_food)
? 'selected':null}}
<option value="{{$val}}" {{$chosen}}>{{$val}}</option>
{{ ($val = 'Hamburgers')
&& $chosen = in_array($val, $food->recommended_food)
? 'selected':null}}
<option value="{{$val}}" {{$chosen}}>{{$val}}</option>
@endif
</select>
array value auto fill in old value laravel 8
<select id="forWhom" name="forWhom[]" multiple class="form-control chosen">
<option value="">--- Select ---</option>
@foreach ($desgInfo as $key => $value)
<option value="{{ $key }}"
{{ (collect(old('forWhom'))->contains($key)) ? 'selected':'' }} />
{{ $value }}
</option>
@endforeach
</select>
array value auto fill in old value laravel 8
{{ (collect(old('forWhom'))->contains($key)) ? 'selected':'' }}
{{ (in_array($key,$info->forWhom)) ? 'selected' : ''}}
array value auto fill in old value laravel 8
<select id="forWhom" name="forWhom[]" multiple class="form-control chosen">
<option value="">--- Select ---</option>
@foreach ($desgInfo as $key => $value)
<option value="{{ $key }}"
{{ (collect(old('forWhom'))->contains($key)) ? 'selected':'' }}
{{ (in_array($key,$info->forWhom)) ? 'selected' : ''}}
/>
{{ $value }}
</option>
@endforeach
</select>
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>
array value auto fill in old value laravel 8
<label for="name">Tags</label>
<select name="tags[]" class="form-control select-tag" multiple>
@foreach($tags as $tag)
<option value="{{$tag->id}}" {{in_array($tag->id, old("tags") ?: []) ? "selected": ""}}>{{$tag->name}}</option>
@endforeach
</select>
array value auto fill in old value laravel 8
<select id="recommended_food" multiple="multiple" size=3 style='height: 100%;' name="recommended_food[]">
@if ($food->recomemded_food)
{{ ($val = 'Fries')
&& $chosen = in_array($val, $food->recommended_food)
? 'selected':null}}
<option value="{{$val}}" {{$chosen}}>{{$val}}</option>
{{ ($val = 'Hot Dogs')
&& $chosen = in_array($val, $food->recommended_food)
? 'selected':null}}
<option value="{{$val}}" {{$chosen}}>{{$val}}</option>
{{ ($val = 'Hamburgers')
&& $chosen = in_array($val, $food->recommended_food)
? 'selected':null}}
<option value="{{$val}}" {{$chosen}}>{{$val}}</option>
@endif
</select>
array value auto fill in old value laravel 8
<select id="forWhom" name="forWhom[]" multiple class="form-control chosen">
<option value="">--- Select ---</option>
@foreach ($desgInfo as $key => $value)
<option value="{{ $key }}"
{{ (collect(old('forWhom'))->contains($key)) ? 'selected':'' }} />
{{ $value }}
</option>
@endforeach
</select>
array value auto fill in old value laravel 8
{{ (collect(old('forWhom'))->contains($key)) ? 'selected':'' }}
{{ (in_array($key,$info->forWhom)) ? 'selected' : ''}}
array value auto fill in old value laravel 8
<select id="forWhom" name="forWhom[]" multiple class="form-control chosen">
<option value="">--- Select ---</option>
@foreach ($desgInfo as $key => $value)
<option value="{{ $key }}"
{{ (collect(old('forWhom'))->contains($key)) ? 'selected':'' }}
{{ (in_array($key,$info->forWhom)) ? 'selected' : ''}}
/>
{{ $value }}
</option>
@endforeach
</select>
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>