Laravel 4 blade drop-down list class attribute

html-select, laravel, laravel-blade

Solution

{{ Form::select('product_id', $productList, null, array('class' => 'form-control')) }}

The third parameter is the key of the currently selected option. Defaults to null.

Problem

Laravel blade drop down list class attribute not working. I cannot find any reference to class or assigning attributes to select / drop-down lists in the documentation. http://www.laravel.com/docs/html#drop-down-lists Examples tried: ``` {{ Form::select('product_id', $productList, array('class'=>'form-control')) }} {{ Form::select('product_id', $productList, $attributes = array('class'=>'form-control')) }} ``` Both return the same html but without the `class` attribute: ``` <select id="product_id" name="product_id"> ... Option Stuff ... </select> ```

Original source