Old value in multiple select option in laravel blade

前端 未结 9 1395
感动是毒
感动是毒 2021-02-13 12:08

Here is my select option


    
    @foreach ($desgInfo as $key => $value)
        
    @endforeach

During Edit

You need to add

{{ (collect(old('forWhom'))->contains($key)) ? 'selected':'' }} 

{{ (in_array($key,$info->forWhom)) ? 'selected' : ''}}

which will look like


Select all selected id's in a multiselect dropdown in laravel 5.4 with harvest chosen

Thanks

提交回复
热议问题