We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 92a1ce8 commit a5d9b45Copy full SHA for a5d9b45
src/Illuminate/Collections/helpers.php
@@ -179,8 +179,8 @@ function last($array)
179
* @param mixed $value
180
* @return mixed
181
*/
182
- function value($value)
+ function value($value, ...$args)
183
{
184
- return $value instanceof Closure ? $value() : $value;
+ return $value instanceof Closure ? $value(...$args) : $value;
185
}
186
tests/Support/SupportHelpersTest.php
@@ -40,6 +40,9 @@ public function testValue()
40
$this->assertSame('foo', value(function () {
41
return 'foo';
42
}));
43
+ $this->assertSame('foo', value(function ($arg) {
44
+ return $arg;
45
+ }, 'foo'));
46
47
48
public function testObjectGet()
0 commit comments