Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add Class to select element on Laravel

I have this problem, I can't find the way to add class attribute in this Dropdown box

{{Form::select('bancada', Bancada::lists('nombre','idBancada'))}}

I have tried various syntax, but can not get it to work.

Any suggestions? Thanks

like image 635
Iván F Avatar asked Nov 09 '14 18:11

Iván F


2 Answers

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

In above example you can add class as fourth parameter

like image 60
Nikunj K. Avatar answered Nov 02 '22 13:11

Nikunj K.


Use the forth parameter to add attributes to your element.

{{Form::select('bancada', Bancada::lists('nombre','idBancada'), null, ['class' => 'my_class'])}}

Take a look at the source ($options is the same as attributes for your element).

like image 21
Marwelln Avatar answered Nov 02 '22 13:11

Marwelln