@@ 109-118 (lines=10) @@ | ||
106 | ->toArray(); |
|
107 | } |
|
108 | ||
109 | public function avg($column) |
|
110 | { |
|
111 | $tags = [str_slug(get_class($this->model))]; |
|
112 | $key = str_slug(get_class($this->model)) ."-avg_{$column}"; |
|
113 | ||
114 | return $this->cache($tags) |
|
115 | ->rememberForever($key, function () use ($column) { |
|
116 | return parent::avg($column); |
|
117 | }); |
|
118 | } |
|
119 | ||
120 | public function count($columns = ['*']) |
|
121 | { |
|
@@ 120-129 (lines=10) @@ | ||
117 | }); |
|
118 | } |
|
119 | ||
120 | public function count($columns = ['*']) |
|
121 | { |
|
122 | $tags = [str_slug(get_class($this->model))]; |
|
123 | $key = str_slug(get_class($this->model)) ."-count"; |
|
124 | ||
125 | return $this->cache($tags) |
|
126 | ->rememberForever($key, function () use ($columns) { |
|
127 | return parent::count($columns); |
|
128 | }); |
|
129 | } |
|
130 | ||
131 | public function cursor() |
|
132 | { |
|
@@ 131-140 (lines=10) @@ | ||
128 | }); |
|
129 | } |
|
130 | ||
131 | public function cursor() |
|
132 | { |
|
133 | $tags = [str_slug(get_class($this->model))]; |
|
134 | $key = str_slug(get_class($this->model)) ."-cursor"; |
|
135 | ||
136 | return $this->cache($tags) |
|
137 | ->rememberForever($key, function () { |
|
138 | return collect(parent::cursor()); |
|
139 | }); |
|
140 | } |
|
141 | ||
142 | /** |
|
143 | * @SuppressWarnings(PHPMD.ShortVariable) |
|
@@ 178-187 (lines=10) @@ | ||
175 | }); |
|
176 | } |
|
177 | ||
178 | public function max($column) |
|
179 | { |
|
180 | $tags = [str_slug(get_class($this->model))]; |
|
181 | $key = str_slug(get_class($this->model)) ."-max_{$column}"; |
|
182 | ||
183 | return $this->cache($tags) |
|
184 | ->rememberForever($key, function () use ($column) { |
|
185 | return parent::max($column); |
|
186 | }); |
|
187 | } |
|
188 | ||
189 | public function min($column) |
|
190 | { |
|
@@ 189-198 (lines=10) @@ | ||
186 | }); |
|
187 | } |
|
188 | ||
189 | public function min($column) |
|
190 | { |
|
191 | $tags = [str_slug(get_class($this->model))]; |
|
192 | $key = str_slug(get_class($this->model)) ."-min_{$column}"; |
|
193 | ||
194 | return $this->cache($tags) |
|
195 | ->rememberForever($key, function () use ($column) { |
|
196 | return parent::min($column); |
|
197 | }); |
|
198 | } |
|
199 | ||
200 | public function pluck($column, $key = null) |
|
201 | { |
|
@@ 215-224 (lines=10) @@ | ||
212 | }); |
|
213 | } |
|
214 | ||
215 | public function sum($column) |
|
216 | { |
|
217 | $tags = [str_slug(get_class($this->model))]; |
|
218 | $key = str_slug(get_class($this->model)) ."-sum_{$column}"; |
|
219 | ||
220 | return $this->cache($tags) |
|
221 | ->rememberForever($key, function () use ($column) { |
|
222 | return parent::sum($column); |
|
223 | }); |
|
224 | } |
|
225 | } |
|
226 |