Row adding, some webpack tweaks
This commit is contained in:
+7
-1
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user