How to add "selected" on the dropdown option in Laravel?
I am doing editing profile. In the profile I have a dropdown list, the options are pulled from database, like this.
//Controller
$gender= Gender::lists('gender', 'id');
//View
{{ Form::select('gender', $gender, null, array('class' => 'form-control')) }}
//Output
<select class="form-control" name="gender"><option value="1">Male</option><option value="2">Female</option></select>
My question: If the user is female, how to add "selected" in the female option if the user has saved female in database before, so that I can show the gender when the page is loaded?