From 16a056d1bfe1c3d03e74e67f5c526378c4cbf3d4 Mon Sep 17 00:00:00 2001 From: Roy Duineveld Date: Fri, 6 Dec 2019 15:22:26 +0100 Subject: [PATCH] Nullable support --- src/Items.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Items.php b/src/Items.php index c489087..bf3a4d7 100644 --- a/src/Items.php +++ b/src/Items.php @@ -25,7 +25,7 @@ public function resolve($resource, $attribute = null) parent::resolve($resource, $attribute); $this->fillUsing(function($request, $model, $attribute, $requestAttribute) { - $model->$attribute = json_decode($request->$attribute, true); + $model->$attribute = $this->isNullValue($request->$attribute) ? null : json_decode($request->$attribute, true); }); $this->withMeta([