Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b79edc7acf | ||
|
|
215f20b8c2 |
No files matched your search
+7
-7
@@ -19,14 +19,14 @@
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.0.0",
|
||||
"illuminate/http": "5.6.x-dev",
|
||||
"illuminate/routing": "5.6.x-dev",
|
||||
"illuminate/session": "5.6.x-dev",
|
||||
"illuminate/support": "5.6.x-dev",
|
||||
"illuminate/view": "5.6.x-dev"
|
||||
"illuminate/http": "5.5.*",
|
||||
"illuminate/routing": "5.5.*",
|
||||
"illuminate/session": "5.5.*",
|
||||
"illuminate/support": "5.5.*",
|
||||
"illuminate/view": "5.5.*"
|
||||
},
|
||||
"require-dev": {
|
||||
"illuminate/database": "5.6.x-dev",
|
||||
"illuminate/database": "5.5.*",
|
||||
"mockery/mockery": "~0.9.4",
|
||||
"phpunit/phpunit": "~5.4"
|
||||
},
|
||||
@@ -40,7 +40,7 @@
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "5.6-dev"
|
||||
"dev-master": "5.5.*"
|
||||
},
|
||||
"laravel": {
|
||||
"providers": [
|
||||
|
||||
+4
-2
@@ -572,7 +572,7 @@ class FormBuilder
|
||||
*
|
||||
* @param string $name
|
||||
* @param array $list
|
||||
* @param string $selected
|
||||
* @param string|bool $selected
|
||||
* @param array $selectAttributes
|
||||
* @param array $optionsAttributes
|
||||
* @param array $optgroupsAttributes
|
||||
@@ -784,7 +784,9 @@ class FormBuilder
|
||||
} elseif ($selected instanceof Collection) {
|
||||
return $selected->contains($value) ? 'selected' : null;
|
||||
}
|
||||
|
||||
if (is_int($value) && is_bool($selected)) {
|
||||
return (bool)$value === $selected;
|
||||
}
|
||||
return ((string) $value === (string) $selected) ? 'selected' : null;
|
||||
}
|
||||
|
||||
|
||||
@@ -464,6 +464,12 @@ class FormBuilderTest extends PHPUnit_Framework_TestCase
|
||||
'<select name="countries"><option value="1" selected="selected">L</option><option value="2">M</option></select>',
|
||||
$result
|
||||
);
|
||||
|
||||
$select = $this->formBuilder->select('avc', [1 => 'Yes', 0 => 'No'], true, ['placeholder' => 'Select']);
|
||||
$this->assertEquals(
|
||||
'<select name="avc"><option value="">Select</option><option value="1" selected>Yes</option><option value="0" >No</option></select>',
|
||||
$select
|
||||
);
|
||||
}
|
||||
|
||||
public function testSelectCollection()
|
||||
|
||||
Reference in new issue
Block a user