Skip to content

Commit

Permalink
Merge branch 'main' of github.com:statikbe/laravel-filament-flexible-…
Browse files Browse the repository at this point in the history
…content-blocks
  • Loading branch information
sten committed Nov 7, 2023
2 parents eb4262b + bc9137d commit 21bb65a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Models/Concerns/HasParentTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit 21bb65a

Please sign in to comment.