Skip to content

Commit fbb9c4d

Browse files
authored
Merge pull request #7805 from sammyskills/fix-view-cell-docs
docs: used default methods for view cell
2 parents b6c3977 + e1b8599 commit fbb9c4d

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(10);
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(10);
2122
}
2223
}

0 commit comments

Comments
 (0)