| 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; |
||
| 32 | public function compose(View $view) |
||
| 33 | { |
||
| 34 | /** |
||
| 35 | * @var \Carbon\Carbon $start |
||
| 36 | * @var \Carbon\Carbon $end |
||
| 37 | * @var \Illuminate\Support\Collection $range |
||
| 38 | */ |
||
| 39 | extract(DateRange::getCurrentMonthDaysRange()); |
||
|
|
|||
| 40 | |||
| 41 | $visitors = $this->getCachedVisitors() |
||
| 42 | ->filter(function (Session $visitor) use ($start, $end) { |
||
| 43 | return $visitor->updated_at->between($start, $end); |
||
| 44 | }); |
||
| 45 | |||
| 46 | $view->with('uniqueUsersCount', $visitors->count()); |
||
| 47 | } |
||
| 48 | } |
||
| 49 |