Skip to content
This repository was archived by the owner on Jan 27, 2020. It is now read-only.

Commit efb0b92

Browse files
committed
Small fix in the default logic
1 parent 333fb4f commit efb0b92

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/Translatable.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@
88
*/
99
trait Translatable
1010
{
11-
/**
12-
* Set to false to avoid setting the json_encode as utf8
13-
*
14-
* @var bool
15-
*/
16-
public $jsonAsUtf = true;
1711

1812
/**
1913
* @param string $key
@@ -89,7 +83,11 @@ protected function isJsonCastable($key)
8983
*/
9084
protected function asJson($value)
9185
{
92-
$mode = ( ! $this->jsonAsUtf) ? 0 : JSON_UNESCAPED_UNICODE;
86+
$mode = JSON_UNESCAPED_UNICODE;
87+
if (isset($this->jsonAsUtf) && $this->jsonAsUtf == false){
88+
$mode = 0;
89+
}
90+
9391
return json_encode($value, $mode);
9492
}
9593
}

0 commit comments

Comments
 (0)