Skip to content

Commit e1b8599

Browse files
committed
Added limit
1 parent 019a59e commit e1b8599

2 files changed

Lines changed: 2 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')->orderBy('created_at', 'DESC')->findAll();
13+
$this->posts = model('PostModel')->orderBy('created_at', 'DESC')->findAll(10);
1414
}
1515
}

user_guide_src/source/outgoing/view_cells/019.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ public function mount(?int $categoryId)
1818
static fn ($query, $categoryId) => $query->where('category_id', $categoryId)
1919
)
2020
->orderBy('created_at', 'DESC')
21-
->findAll();
21+
->findAll(10);
2222
}
2323
}

0 commit comments

Comments
 (0)