Add Class to select element on Laravel

19,849

Solution 1

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).

Solution 2

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

In above example you can add class as fourth parameter

Share:
19,849
Admin
Author by

Admin

Updated on July 22, 2022

Comments

  • Admin
    Admin over 1 year

    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