From 00014b521a3d2c61612a3808ea361e6bad24cd29 Mon Sep 17 00:00:00 2001 From: Andrius Date: Fri, 1 Jun 2018 22:25:32 +0200 Subject: [PATCH] Add a limit(1) since `hasOne` does not append this automatically and expects the key to be unique - could incur weird behavior. --- app/Status.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Status.php b/app/Status.php index 3b597f0d6..b63762904 100644 --- a/app/Status.php +++ b/app/Status.php @@ -20,7 +20,7 @@ class Status extends Model public function firstMedia() { - return $this->hasOne(Media::class)->orderBy('order', 'asc'); + return $this->hasOne(Media::class)->orderBy('order', 'asc')->limit(1); } public function thumb()