From 3879937fe5e71bcde5449726c912ec915ebe2976 Mon Sep 17 00:00:00 2001 From: Rido Mulanda Date: Sun, 20 Aug 2023 00:09:01 +0700 Subject: [PATCH] feat: add parent_id column to fillable at construct --- src/Models/Entity.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Models/Entity.php b/src/Models/Entity.php index b5d04de..d7dad62 100644 --- a/src/Models/Entity.php +++ b/src/Models/Entity.php @@ -115,9 +115,10 @@ class Entity extends Eloquent implements EntityInterface */ public function __construct(array $attributes = []) { - $position = $this->getPositionColumn(); + $position = $this->getPositionColumn(); + $parent_id = $this->getParentIdColumn(); - $this->fillable(array_merge($this->getFillable(), [$position])); + $this->fillable(array_merge($this->getFillable(), [$position, $parent_id])); if (isset($attributes[$position]) && $attributes[$position] < 0) { $attributes[$position] = 0;