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

Commit 5d1db39

Browse files
committed
minor amends
1 parent 1a2f9d0 commit 5d1db39

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/Translatable.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,14 @@ protected function isJsonCastable($key)
7575
}
7676

7777
/**
78-
* Alter default Laravel behaviour when it comes to json_encode.
79-
* This will save the json as UTF-8 to the DB
78+
* Alter the default behaviour when it comes to using json_encode for model attributes,
79+
* this will save the json as UTF-8 to the database instead of escaping characters.
8080
*
81-
* @param $value
81+
* @param array $value
8282
* @return string
8383
*/
8484
protected function asJson($value)
8585
{
86-
$mode = JSON_UNESCAPED_UNICODE;
87-
if (isset($this->jsonAsUtf) && $this->jsonAsUtf == false){
88-
$mode = 0;
89-
}
90-
91-
return json_encode($value, $mode);
86+
return json_encode($value, JSON_UNESCAPED_UNICODE);
9287
}
93-
}
88+
}

0 commit comments

Comments
 (0)