From 6b1393e468ac847960e8f3ccba4814d808fbfae5 Mon Sep 17 00:00:00 2001 From: Jesse Leite Date: Thu, 4 Jan 2024 18:57:13 -0500 Subject: [PATCH] Sort report pages by canonical URL. --- src/Reporting/Report.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Reporting/Report.php b/src/Reporting/Report.php index b1eb4964..8e7d9d89 100644 --- a/src/Reporting/Report.php +++ b/src/Reporting/Report.php @@ -279,7 +279,10 @@ public function withPages($preferCache = false) $this->pages = collect($files) ->map(fn ($file) => YAML::parse(File::get($file))) - ->map(fn ($yaml) => (new Page($yaml['id'], $yaml['data'], $this))->setResults($yaml['results'])); + ->map(fn ($yaml) => (new Page($yaml['id'], $yaml['data'], $this))->setResults($yaml['results'])) + ->sortBy + ->url() + ->values(); if ($this->isGenerated()) { Cache::put($this->cacheKey(static::PAGES_CACHE_KEY_SUFFIX), $this->pages);