Sort bundles in term pages
This commit is contained in:
parent
544af4e2a7
commit
2f7e612b1e
|
@ -19,6 +19,10 @@ public function render()
|
||||||
foreach ($bundles as $path) {
|
foreach ($bundles as $path) {
|
||||||
$relations[$category][] = new Bundle($path, $this->bundle->getDisk());
|
$relations[$category][] = new Bundle($path, $this->bundle->getDisk());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$relations[$category] = collect($relations[$category])->sortByDesc(function (Bundle $bundle) {
|
||||||
|
return $bundle->metadata()->get('date');
|
||||||
|
})->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
data_set($this->viewData, 'relations', $relations);
|
data_set($this->viewData, 'relations', $relations);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user