Skip to content

Commit

Permalink
staudenmeir#259: Updated to match schema
Browse files Browse the repository at this point in the history
  • Loading branch information
tylernathanreed committed Sep 6, 2024
1 parent d1090c5 commit 75dac50
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/Tree/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,28 +216,28 @@ public function videosAndSelf(): MorphToManyOfDescendants
}

/**
* @return Attribute<string, never>
* @return Attribute<string,never>
*/
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<string, never>
* @return Attribute<string,never>
*/
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;
}),
);
}
Expand Down

0 comments on commit 75dac50

Please sign in to comment.