File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -56,8 +56,11 @@ public function run(): View
56
56
$ differenceArticle = $ currentMonthArticles - $ lastMonthArticles ;
57
57
58
58
$ totalViews = views (Article::class)->count ();
59
- $ lastMonthViews = views (Article::class)->period (Period::pastMonths (1 ))->count ();
60
- $ currentViews = views (Article::class)->period (Period::create (now ()->startOfMonth ()))->count ();
59
+ $ lastMonthViews = views (Article::class)
60
+ ->period (Period::create (now ()->subMonth ()->startOfMonth (), now ()->subMonth ()->endOfMonth ()))
61
+ ->remember (now ()->addMonth ())
62
+ ->count ();
63
+ $ currentViews = views (Article::class)->period (Period::upto (now ()->startOfMonth ()))->count ();
61
64
$ differenceViews = $ currentViews - $ lastMonthViews ;
62
65
63
66
return view ('widgets.recent_numbers ' , [
You can’t perform that action at this time.
0 commit comments