@@ 129-138 (lines=10) @@ | ||
126 | ->toArray(); |
|
127 | } |
|
128 | ||
129 | public function avg($column) |
|
130 | { |
|
131 | $tags = [str_slug(get_class($this->model))]; |
|
132 | $key = str_slug(get_class($this->model)) ."-avg_{$column}"; |
|
133 | ||
134 | return $this->cache($tags) |
|
135 | ->rememberForever($key, function () use ($column) { |
|
136 | return parent::avg($column); |
|
137 | }); |
|
138 | } |
|
139 | ||
140 | public function count($columns = ['*']) |
|
141 | { |
|
@@ 140-149 (lines=10) @@ | ||
137 | }); |
|
138 | } |
|
139 | ||
140 | public function count($columns = ['*']) |
|
141 | { |
|
142 | $tags = [str_slug(get_class($this->model))]; |
|
143 | $key = str_slug(get_class($this->model)) ."-count"; |
|
144 | ||
145 | return $this->cache($tags) |
|
146 | ->rememberForever($key, function () use ($columns) { |
|
147 | return parent::count($columns); |
|
148 | }); |
|
149 | } |
|
150 | ||
151 | public function cursor() |
|
152 | { |
|
@@ 151-160 (lines=10) @@ | ||
148 | }); |
|
149 | } |
|
150 | ||
151 | public function cursor() |
|
152 | { |
|
153 | $tags = [str_slug(get_class($this->model))]; |
|
154 | $key = str_slug(get_class($this->model)) ."-cursor"; |
|
155 | ||
156 | return $this->cache($tags) |
|
157 | ->rememberForever($key, function () { |
|
158 | return collect(parent::cursor()); |
|
159 | }); |
|
160 | } |
|
161 | ||
162 | /** |
|
163 | * @SuppressWarnings(PHPMD.ShortVariable) |
|
@@ 198-207 (lines=10) @@ | ||
195 | }); |
|
196 | } |
|
197 | ||
198 | public function max($column) |
|
199 | { |
|
200 | $tags = [str_slug(get_class($this->model))]; |
|
201 | $key = str_slug(get_class($this->model)) ."-max_{$column}"; |
|
202 | ||
203 | return $this->cache($tags) |
|
204 | ->rememberForever($key, function () use ($column) { |
|
205 | return parent::max($column); |
|
206 | }); |
|
207 | } |
|
208 | ||
209 | public function min($column) |
|
210 | { |
|
@@ 209-218 (lines=10) @@ | ||
206 | }); |
|
207 | } |
|
208 | ||
209 | public function min($column) |
|
210 | { |
|
211 | $tags = [str_slug(get_class($this->model))]; |
|
212 | $key = str_slug(get_class($this->model)) ."-min_{$column}"; |
|
213 | ||
214 | return $this->cache($tags) |
|
215 | ->rememberForever($key, function () use ($column) { |
|
216 | return parent::min($column); |
|
217 | }); |
|
218 | } |
|
219 | ||
220 | public function pluck($column, $key = null) |
|
221 | { |
|
@@ 235-244 (lines=10) @@ | ||
232 | }); |
|
233 | } |
|
234 | ||
235 | public function sum($column) |
|
236 | { |
|
237 | $tags = [str_slug(get_class($this->model))]; |
|
238 | $key = str_slug(get_class($this->model)) ."-sum_{$column}"; |
|
239 | ||
240 | return $this->cache($tags) |
|
241 | ->rememberForever($key, function () use ($column) { |
|
242 | return parent::sum($column); |
|
243 | }); |
|
244 | } |
|
245 | } |
|
246 |