I've got a string value from a controller which is:
$pickedValues = "1,2";
So what I'm trying to do is set the multiple selected values on the view, here is the select code that I have right now:
{{Form::select("selection[]", $data, (isset($pickedValues)) ? array($pickedValues) : '',
[
"class" => "multiple-select",
"multiple",
])
}}
That problem that I'm getting right now that it is not displaying the selected options, but if I put the values manually like array(1,2) it works. I've tried setting it as array((int)$pickedValues) but it only displays the value 1.
explode(',' $pickedValues)instead ofarray($pickedValues)... - kiskeexplode(',', $pickedValues), I forgot the comma... - kiske