From c2b0b69eb2e8ba58c007bfb3fc7fc77448b5b731 Mon Sep 17 00:00:00 2001 From: "B.Fatih KOZ" <74361521+FatihKoz@users.noreply.github.com> Date: Thu, 25 Mar 2021 16:51:16 +0300 Subject: [PATCH] Change LatestPireps Widget Sort Order (#1099) * Change LatestPireps Widget Sort Order Latest pireps should be ordered by `submitted_at` instead of `created_at` . Pirep may be created even a day before others (with the pause/resume ability we have in acars) but it gets submitted once when the flight is ended, thus I think it should be our reference to sort them in proper order. * Trying to Pass UnitTest --- app/Widgets/LatestPireps.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Widgets/LatestPireps.php b/app/Widgets/LatestPireps.php index 52c24123..7e36c8be 100644 --- a/app/Widgets/LatestPireps.php +++ b/app/Widgets/LatestPireps.php @@ -8,6 +8,7 @@ use App\Repositories\PirepRepository; /** * Show the latest PIREPs in a view + * sorted nicely by their submit time */ class LatestPireps extends Widget { @@ -28,7 +29,7 @@ class LatestPireps extends Widget PirepState::CANCELLED, PirepState::DRAFT, PirepState::IN_PROGRESS, - ], 'created_at', 'desc') + ], 'submitted_at', 'desc') ->recent($this->config['count']); return view('widgets.latest_pireps', [