Skip to content

Commit 019a59e

Browse files
committed
Used default methods instead of custom methods
1 parent 6dfc38b commit 019a59e

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

user_guide_src/source/outgoing/view_cells/018.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ class RecentPostsCell extends Cell
1010

1111
public function mount()
1212
{
13-
$this->posts = model('PostModel')->getRecent();
13+
$this->posts = model('PostModel')->orderBy('created_at', 'DESC')->findAll();
1414
}
1515
}

user_guide_src/source/outgoing/view_cells/019.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public function mount(?int $categoryId)
1717
$categoryId,
1818
static fn ($query, $categoryId) => $query->where('category_id', $categoryId)
1919
)
20-
->getRecent();
20+
->orderBy('created_at', 'DESC')
21+
->findAll();
2122
}
2223
}

0 commit comments

Comments
 (0)