diff --git a/src/Controllers/NewsController.php b/src/Controllers/NewsController.php index c2c35761..e8e9d311 100644 --- a/src/Controllers/NewsController.php +++ b/src/Controllers/NewsController.php @@ -136,6 +136,7 @@ class NewsController extends BaseController ->orderByDesc('is_pinned') ->orderByDesc('is_important') ->orderByDesc('updated_at') + ->orderByDesc('id') ->limit($perPage) ->offset(($page - 1) * $perPage) ->get(); diff --git a/tests/Unit/Controllers/NewsControllerTest.php b/tests/Unit/Controllers/NewsControllerTest.php index 329a68a0..cb6e5e15 100644 --- a/tests/Unit/Controllers/NewsControllerTest.php +++ b/tests/Unit/Controllers/NewsControllerTest.php @@ -98,7 +98,7 @@ class NewsControllerTest extends ControllerTest $this->assertEquals(3, $data['pages']); $this->assertEquals(2, $data['page']); $this->assertTrue($news[0]->is_pinned); - $this->assertEquals('Ipsum', $news[0]->title); + $this->assertEquals('Bar', $news[0]->title); break; case 2: // Show meetings