I need to give selected value like this html:
<select name="myselect" id="myselect">
<option value="1">Item 1</option>
<option value="2" selected='selected'>Item 2</option>
how can I achieve this, with laravel forms?
I need to give selected value like this html:
<select name="myselect" id="myselect">
<option value="1">Item 1</option>
<option value="2" selected='selected'>Item 2</option>
how can I achieve this, with laravel forms?
If you have an Eloquent Relationship between your models you can do something like that:
You have to set the default option by passing a third argument.
You can read the documentation here.
Another ordinary simple way this is good if there are few options in select box
This show similar types of following options :
You can do it like this.