Form::macro('multiselect', function($name, $list = [], array $selected = [], $options = [])
{
$options['name'] = $name;
$html = array();
if (is_string($selected)) $selected[$selected] = $selected;
//dd($list, $selected);
foreach ($list as $value => $display)
{
$sel = isset($selected[$value])?' selected="selected"':'';
$html[] = '';
}
// build out a final select statement, which will contain all the values.
$options = HTML::attributes($options);
$list = implode('', $html);
return "";
});