From 75dac506bafc579b35efff6aeb3350a5b986a377 Mon Sep 17 00:00:00 2001 From: Tyler Date: Fri, 6 Sep 2024 08:35:10 -0500 Subject: [PATCH] #259: Updated to match schema --- tests/Tree/Models/User.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/Tree/Models/User.php b/tests/Tree/Models/User.php index 2df212b..6b45d19 100644 --- a/tests/Tree/Models/User.php +++ b/tests/Tree/Models/User.php @@ -216,28 +216,28 @@ public function videosAndSelf(): MorphToManyOfDescendants } /** - * @return Attribute + * @return Attribute */ - protected function displayPath(): Attribute + protected function slugPath(): Attribute { return Attribute::get( fn (): string => (string) $this->ancestorsAndSelf ->reverse() - ->reduce(function ($carry, $item) { - return $carry ? "{$carry} > {$item->name}" : $item->name; + ->reduce(function ($carry, $user) { + return $carry ? "{$carry} > {$user->slug}" : $user->slug; }), ); } /** - * @return Attribute + * @return Attribute */ - protected function displayPathReverse(): Attribute + protected function reverseSlugPath(): Attribute { return Attribute::get( fn (): string => (string) $this->ancestorsAndSelf - ->reduce(function ($carry, $item) { - return $carry ? "{$carry} < {$item->name}" : $item->name; + ->reduce(function ($carry, $user) { + return $carry ? "{$carry} < {$user->slug}" : $user->slug; }), ); }