diff --git a/src/InteractsWithViews.php b/src/InteractsWithViews.php index 232d045..e8f53e6 100644 --- a/src/InteractsWithViews.php +++ b/src/InteractsWithViews.php @@ -50,7 +50,7 @@ public function scopeOrderByViews( string $as = 'views_count' ): Builder { return $query->withViewsCount($period, $collection, $unique, $as) - ->orderBy($as, $direction); + ->orderBy('id', $direction); } /**