how to retrieve data from database using select option in laravel

Solutions on MaxInterview for how to retrieve data from database using select option in laravel by the best coders in the world

showing results for - "how to retrieve data from database using select option in laravel"
Chiara
11 Nov 2017
1<select class="form-control" name="product_id">
2    <option>Select Product</option>
3    @foreach ($products as $key => $value)
4        <option value="{{ $key }}" {{ ( $key == $selectedID) ? 'selected' : '' }}> 
5            {{ $value }} 
6        </option>
7    @endforeach    
8</select>
9