Row adding, some webpack tweaks

This commit is contained in:
2018-08-05 23:26:37 +02:00
parent 671fb9b024
commit ace61f2a07
26 changed files with 628 additions and 133 deletions
+7 -1
View File
@@ -84,7 +84,13 @@ function old_json($name, $default) {
}
// Safe JSON funcs
function toJSON($object) {
function toJSON($object, $emptyObj=false) {
if ($emptyObj) {
if ((empty($object) || ($object instanceof \Illuminate\Support\Collection && $object->count()==0))) {
return '{}';
}
}
if (!$object instanceof JsonSerializable && $object instanceof \Illuminate\Contracts\Support\Arrayable) {
$object = $object->toArray();
}