Skip to content

Commit 4b7fd78

Browse files
authored
feat:[LAR-171] limit number of article (#307)
2 parents 970a351 + c59da67 commit 4b7fd78

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

app/Filament/Resources/ArticleResource/Widgets/MostLikedPostsChart.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ protected function getData(): array
2222
{
2323
$articles = Article::published()
2424
->popular()
25+
->limit(10)
2526
->get();
2627

2728
return [

app/Filament/Resources/ArticleResource/Widgets/MostViewedPostsChart.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ protected function getData(): array
2525
->published()
2626
->orderByDesc('views_count')
2727
->orderByDesc('published_at')
28+
->limit(10)
2829
->get();
2930

3031
return [

app/Filament/Resources/UserResource/Widgets/UserChartWidget.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,15 @@ protected function getType(): string
7676
{
7777
return 'line';
7878
}
79+
80+
protected function getOptions(): array
81+
{
82+
return [
83+
'scales' => [
84+
'y' => [
85+
'beginAtZero' => true,
86+
],
87+
],
88+
];
89+
}
7990
}

0 commit comments

Comments
 (0)