According with https://laravelcollective.com/docs/5.2/html#drop-down-lists
Form::select('size[]',['L' => 'Large', 'M' => 'Medium', 'S' => 'Small'], ['S', 'M'], ['multiple' => 'multiple', 'class' => 'form-control']);
By the way, please notice dropdown's name (size[]) if you want to be able to use this field as array in your backend.
Things get tricky when you want uses relationships as value, for instance
models
user => common fields
size => id, name, slug [
{id : 1 , name : Large, slug : L},
{id : 2 , name : Small, slug : S},
{id : 3 , name : Medium, slug : M}
]
user_size => id, user_id, size_id [
{id :1, user_id:1, size_id:1}
{id :2, user_id:1, size_id:3}
]
So $user->colors
will return something like
laravel collection
[
USER_SIZE => [ 'user_id' => 1 , size_id' => 1 ],
USER_SIZE => [ 'user_id' => 1, 'size_id' => 3 ]
]
You could do something like, remember User Model
have a sizes
relationship of one to many with SIZE Model
Form::select('size[]',['L' => 'Large', 'M' => 'Medium', 'S' => 'Small'], $user->sizes->pluck('size')->pluck('slug')->toArray(), ['multiple' => 'multiple', 'class' => 'form-control']);
Hope it helps
size[]
instead ofsize
did what I had intended. – Coombs