Conditions | 1 |
Paths | 1 |
Total Lines | 16 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php namespace Arcanesoft\Tracker\ViewComposers\Dashboard; |
||
31 | public function compose(View $view) |
||
32 | { |
||
33 | /** |
||
34 | * @var \Carbon\Carbon $start |
||
35 | * @var \Carbon\Carbon $end |
||
36 | * @var \Illuminate\Support\Collection $range |
||
37 | */ |
||
38 | extract(DateRange::getCurrentMonthDaysRange()); |
||
|
|||
39 | |||
40 | $visits = $this->getCachedVisits() |
||
41 | ->filter(function (SessionActivity $activity) use ($start, $end) { |
||
42 | return $activity->created_at->between($start, $end); |
||
43 | }); |
||
44 | |||
45 | $view->with('pageViewsCount', $visits->count()); |
||
46 | } |
||
47 | } |
||
48 |