laravel display multiple selected values

Solutions on MaxInterview for laravel display multiple selected values by the best coders in the world

showing results for - "laravel display multiple selected values"
Vincent
08 Oct 2019
1$selected = explode(",", $products->supplier_id);
2
3<select  name="supplier_id[]" multiple="multiple">
4   @foreach($suppliers as $supplier)
5     <option value="{{ $supplier->id }}" {{ (in_array($supplier->id, $selected)) ? 'selected' : '' }}>{{ $supplier->name}}</option>
6   @endforeach
7</select>
8