Skip to content

Commit b73ac01

Browse files
authored
Pass flags to custom Json::$encoder (#55548)
1 parent bedb09d commit b73ac01

File tree

1 file changed

+3
-1
lines changed
  • src/Illuminate/Database/Eloquent/Casts

1 file changed

+3
-1
lines changed

src/Illuminate/Database/Eloquent/Casts/Json.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ class Json
2323
*/
2424
public static function encode(mixed $value, int $flags = 0): mixed
2525
{
26-
return isset(static::$encoder) ? (static::$encoder)($value) : json_encode($value, $flags);
26+
return isset(static::$encoder)
27+
? (static::$encoder)($value, $flags)
28+
: json_encode($value, $flags);
2729
}
2830

2931
/**

0 commit comments

Comments
 (0)