Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f1eddc7a78 | ||
|
|
745c10226d | ||
|
|
a0a763779d | ||
|
|
e4b32919a3 |
No files matched your search
+10
-4
@@ -13,10 +13,10 @@
|
|||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.4.0",
|
"php": ">=5.4.0",
|
||||||
"illuminate/http": "~5.0",
|
"illuminate/http": "~5.1",
|
||||||
"illuminate/routing": "~5.0",
|
"illuminate/routing": "~5.1",
|
||||||
"illuminate/session": "~5.0",
|
"illuminate/session": "~5.1",
|
||||||
"illuminate/support": "~5.0"
|
"illuminate/support": "~5.1"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"mockery/mockery": "~0.9",
|
"mockery/mockery": "~0.9",
|
||||||
@@ -29,5 +29,11 @@
|
|||||||
"files": [
|
"files": [
|
||||||
"src/helpers.php"
|
"src/helpers.php"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "5.1-dev"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"minimum-stability": "dev"
|
||||||
}
|
}
|
||||||
+1
-8
@@ -935,14 +935,7 @@ class FormBuilder {
|
|||||||
*/
|
*/
|
||||||
protected function getModelValueAttribute($name)
|
protected function getModelValueAttribute($name)
|
||||||
{
|
{
|
||||||
if (is_object($this->model))
|
return data_get($this->model, $this->transformKey($name));
|
||||||
{
|
|
||||||
return object_get($this->model, $this->transformKey($name));
|
|
||||||
}
|
|
||||||
elseif (is_array($this->model))
|
|
||||||
{
|
|
||||||
return array_get($this->model, $this->transformKey($name));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -137,6 +137,18 @@ class FormBuilderTest extends PHPUnit_Framework_TestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function testFormRepopulationWithMixOfArraysAndObjects()
|
||||||
|
{
|
||||||
|
$this->formBuilder->model(['user' => (object)['password' => 'apple']]);
|
||||||
|
$input = $this->formBuilder->text('user[password]');
|
||||||
|
$this->assertEquals('<input name="user[password]" type="text" value="apple">', $input);
|
||||||
|
|
||||||
|
$this->formBuilder->model((object)['letters' => ['a', 'b', 'c']]);
|
||||||
|
$input = $this->formBuilder->text('letters[1]');
|
||||||
|
$this->assertEquals('<input name="letters[1]" type="text" value="b">', $input);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function testFormPassword()
|
public function testFormPassword()
|
||||||
{
|
{
|
||||||
$form1 = $this->formBuilder->password('foo');
|
$form1 = $this->formBuilder->password('foo');
|
||||||
|
|||||||
Reference in new issue
Block a user