Skip to content

Commit 3be013a

Browse files
authored
Merge pull request #35 from dev/patch-1
Fix issues with $fillable vs $guarded
2 parents 76a13c8 + 14f0669 commit 3be013a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/Concern/ModelTree.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@ trait ModelTree
1616

1717
public function initializeModelTree()
1818
{
19-
$this->fillable[] = $this->determineOrderColumnName();
20-
$this->fillable[] = $this->determineParentColumnName();
21-
$this->fillable[] = $this->determineTitleColumnName();
19+
if (!empty($this->getFillable())) {
20+
$this->mergeFillable([
21+
$this->determineOrderColumnName(),
22+
$this->determineParentColumnName(),
23+
$this->determineTitleColumnName(),
24+
]);
25+
}
2226
}
2327

2428
/**

0 commit comments

Comments
 (0)