Skip to content

Commit 9ee0795

Browse files
Revert "Use value() helper in 'when' method to simplify code (#55465)" (#55514)
This reverts commit 48347e5.
1 parent 3faeb07 commit 9ee0795

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Illuminate/Conditionable/Traits/Conditionable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ trait Conditionable
2020
*/
2121
public function when($value = null, ?callable $callback = null, ?callable $default = null)
2222
{
23-
$value = value($value, $this);
23+
$value = $value instanceof Closure ? $value($this) : $value;
2424

2525
if (func_num_args() === 0) {
2626
return new HigherOrderWhenProxy($this);

0 commit comments

Comments
 (0)