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