From bc9137dadaee35d22a7995d6969f8cd274cef053 Mon Sep 17 00:00:00 2001 From: sten Date: Tue, 7 Nov 2023 21:22:37 +0000 Subject: [PATCH] Fix styling --- src/Models/Concerns/HasParentTrait.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Models/Concerns/HasParentTrait.php b/src/Models/Concerns/HasParentTrait.php index a853a56..767b147 100644 --- a/src/Models/Concerns/HasParentTrait.php +++ b/src/Models/Concerns/HasParentTrait.php @@ -23,11 +23,13 @@ public function children(): HasMany return $this->hasMany(self::class, 'parent_id'); } - public function hasParent(): bool { + public function hasParent(): bool + { return ! is_null($this->parent_id); } - public function isParentOf(self $child): bool { + public function isParentOf(self $child): bool + { return $this->id === $child->parent_id; } }