Let I have HTML
select box like
<select>
<optgroup label="Fruits">
<option>Orange</option>
<option>Apple</option>
</optgroup>
<optgroup label="Food">
<option>Chicket</option>
<option>Beef</option>
</optgroup>
</select>
Now How can I implement this select box in laravel
blade
template engine
Try this;
{{ Form::select('list', array(
'Fruits' => array('Orange', 'Apple'),
'Food' => array('Chicken', 'Beef'),
))}}
The output should be what your looking for.
To assign the values of the select options add keys to the array like '<your_value>' => 'Orange'
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With