Select box with first option empty
问题 Does anybody know how can I set in my select box the first option to empty value? I'm getting the data from my DB, and I would like to set the option by default as "Please select one option". 回答1: I found that 'default'=>'Please select' doesn't work with the HTML5 required attribute. This does work: $listOfValues = [1 => 'Choice 1']; Form::select('fieldname',[null=>'Please Select'] + $listOfValues); If you don't like modern PHP syntax, $listOfValues = array(1 => 'Choice 1'); $listOfValues