From f98ae4d38ecfdc32ea1bd7e75ac3d4631ecc1ca0 Mon Sep 17 00:00:00 2001 From: James Brooks Date: Mon, 2 Jul 2018 22:15:36 +0100 Subject: [PATCH] Order metric points by the created_at time --- app/Models/Metric.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/Metric.php b/app/Models/Metric.php index 54c1b43f..9f0ace39 100644 --- a/app/Models/Metric.php +++ b/app/Models/Metric.php @@ -182,7 +182,7 @@ class Metric extends Model implements HasPresenter */ public function points() { - return $this->hasMany(MetricPoint::class, 'metric_id', 'id'); + return $this->hasMany(MetricPoint::class, 'metric_id', 'id')->latest(); } /**