Skip to content

Commit 1f71c79

Browse files
Fixed support for PHP 5.2 / Laravel 5.2
1 parent 255d127 commit 1f71c79

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424
},
2525
"require-dev": {
2626
"phpunit/phpunit": "~4.0",
27-
"laravel/laravel": "~5.3"
27+
"laravel/laravel": "~5.2"
2828
}
2929
}

src/Form.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,13 @@ public function options($options, $name, $default = null, $placeholder = null)
123123
$tags[] = '<option value="" selected disabled>'.e($placeholder).'</option>';
124124
}
125125

126+
$value = $this->value($name, $default);
127+
126128
// Cast $default and $value to an array in order to support selects with
127129
// multiple options selected.
128-
$value = (array) $this->value($name, (array) $default);
130+
if (! is_array($value)) {
131+
$value = [$value];
132+
}
129133

130134
foreach ($options as $key => $text) {
131135

0 commit comments

Comments
 (0)