1 | <?php namespace Arcanesoft\Tracker\ViewComposers; |
||
16 | abstract class AbstractViewComposer |
||
17 | { |
||
18 | /* ------------------------------------------------------------------------------------------------ |
||
19 | | Properties |
||
20 | | ------------------------------------------------------------------------------------------------ |
||
21 | */ |
||
22 | /** |
||
23 | * The View instance. |
||
24 | * |
||
25 | * @var \Illuminate\Contracts\View\View |
||
26 | */ |
||
27 | protected $view; |
||
28 | |||
29 | /** |
||
30 | * Caching time. |
||
31 | * |
||
32 | * @var int |
||
33 | */ |
||
34 | protected $minutes = 5; |
||
35 | |||
36 | /* ------------------------------------------------------------------------------------------------ |
||
37 | | Main Functions |
||
38 | | ------------------------------------------------------------------------------------------------ |
||
39 | */ |
||
40 | /** |
||
41 | * Get the cached visitors. |
||
42 | * |
||
43 | * @return \Illuminate\Database\Eloquent\Collection |
||
44 | */ |
||
45 | protected function getCachedVisitors() |
||
51 | |||
52 | /** |
||
53 | * Get the cached visits. |
||
54 | * |
||
55 | * @return \Illuminate\Database\Eloquent\Collection |
||
56 | */ |
||
57 | protected function getCachedVisits() |
||
63 | |||
64 | /* ------------------------------------------------------------------------------------------------ |
||
65 | | Other Functions |
||
66 | | ------------------------------------------------------------------------------------------------ |
||
67 | */ |
||
68 | /** |
||
69 | * Cache the results. |
||
70 | * |
||
71 | * @param string $name |
||
72 | * @param \Closure $callback |
||
73 | * |
||
74 | * @return mixed |
||
75 | */ |
||
76 | protected function cacheResults($name, Closure $callback) |
||
80 | |||
81 | /** |
||
82 | * Get the filtered visitors by date range. |
||
83 | * |
||
84 | * @param \Carbon\Carbon $start |
||
85 | * @param \Carbon\Carbon $end |
||
86 | * |
||
87 | * @return \Illuminate\Support\Collection |
||
88 | */ |
||
89 | protected function getVisitorsFilteredByDateRange(Carbon $start, Carbon $end) |
||
95 | |||
96 | /** |
||
97 | * Get the filtered visits by date range. |
||
98 | * |
||
99 | * @param \Carbon\Carbon $start |
||
100 | * @param \Carbon\Carbon $end |
||
101 | * |
||
102 | * @return \Illuminate\Support\Collection |
||
103 | */ |
||
104 | protected function getVisitsFilteredByDateRange(Carbon $start, Carbon $end) |
||
110 | } |
||
111 |