Ensure that talks are sorted by the nearest event date
This commit is contained in:
parent
18e6d2e32f
commit
303162e65d
2 changed files with 29 additions and 2 deletions
|
@ -46,7 +46,9 @@ class TalksExtension extends Twig_Extension
|
|||
*/
|
||||
public function getAll($talks, array $eventData = []): Collection
|
||||
{
|
||||
return collect($talks);
|
||||
return collect($talks)->sortBy(function ($talk) {
|
||||
return collect($talk['events'])->pluck('date')->sort()->last();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue