From 09c3b56fc36dfa1c79e7a4df2e408b9bd2e04da6 Mon Sep 17 00:00:00 2001 From: Quentin Gabriele Date: Fri, 12 Jan 2024 13:21:37 +0100 Subject: [PATCH] order by id --- src/Traits/HasMedia.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Traits/HasMedia.php b/src/Traits/HasMedia.php index c00cddd..6c8f383 100644 --- a/src/Traits/HasMedia.php +++ b/src/Traits/HasMedia.php @@ -23,7 +23,8 @@ trait HasMedia public function media(): MorphMany { return $this->morphMany(config('media.model'), 'model') - ->orderByRaw('-order_column DESC'); + ->orderByRaw('-order_column DESC') + ->orderBy('id', 'asc'); } /**