Skip to content

Commit

Permalink
Merge pull request #7805 from sammyskills/fix-view-cell-docs
Browse files Browse the repository at this point in the history
docs: used default methods for view cell
  • Loading branch information
kenjis authored Aug 10, 2023
2 parents b6c3977 + e1b8599 commit fbb9c4d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion user_guide_src/source/outgoing/view_cells/018.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ class RecentPostsCell extends Cell

public function mount()
{
$this->posts = model('PostModel')->getRecent();
$this->posts = model('PostModel')->orderBy('created_at', 'DESC')->findAll(10);
}
}
3 changes: 2 additions & 1 deletion user_guide_src/source/outgoing/view_cells/019.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public function mount(?int $categoryId)
$categoryId,
static fn ($query, $categoryId) => $query->where('category_id', $categoryId)
)
->getRecent();
->orderBy('created_at', 'DESC')
->findAll(10);
}
}

0 comments on commit fbb9c4d

Please sign in to comment.