Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to apply css class to laravel collective select

i used laravel 5.3 for my project, i used laravel form collective into it code is below

{{ Form::select('size', ['surat' => 'surat', 'mumbai' => 'mumbai','hongkong' => 'hongkong'], 'hongkong',['multiple'=>'true'], array('class'=> 'form-control') ) }}

but the array('class'=> 'form-control') is not working for me if i removed ['multiple'=>'true'] then it work properly so how can i apply bootstrap class to my select box.

like image 252
HirenMangukiya Avatar asked Dec 28 '16 08:12

HirenMangukiya


1 Answers

The correct syntax:

{!! Form::select('size', $citiesArray, 'hongkong', ['multiple' => 'true', 'class' => 'form-control']) !!}

You should pass id, class and other attributes in an array as 4th parameter.

like image 125
Alexey Mezenin Avatar answered Nov 11 '22 04:11

Alexey Mezenin