Skip to content

Commit

Permalink
Update UserViewModel.php
Browse files Browse the repository at this point in the history
  • Loading branch information
djaiss committed Jan 3, 2024
1 parent b35ee43 commit df20474
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/Http/ViewModels/User/UserViewModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ public static function favorites(): Collection
// first we get the favorite list
$list = auth()->user()->lists()->where('is_list_of_favorites', true)->firstOrFail();

$names = $list->names()->orderBy('name')->get()->pluck('id');
$names = $list->names()->orderBy('name')->get()->map(function ($name) {
return $name->id;
});

return $names;
}
Expand Down

0 comments on commit df20474

Please sign in to comment.