| @@ 155-164 (lines=10) @@ | ||
| 152 | ->toArray(); |
|
| 153 | } |
|
| 154 | ||
| 155 | public function avg($column) |
|
| 156 | { |
|
| 157 | $tags = [str_slug(get_class($this->model))]; |
|
| 158 | $key = str_slug(get_class($this->model)) ."-avg_{$column}"; |
|
| 159 | ||
| 160 | return $this->cache($tags) |
|
| 161 | ->rememberForever($key, function () use ($column) { |
|
| 162 | return parent::avg($column); |
|
| 163 | }); |
|
| 164 | } |
|
| 165 | ||
| 166 | public function count($columns = ['*']) |
|
| 167 | { |
|
| @@ 166-175 (lines=10) @@ | ||
| 163 | }); |
|
| 164 | } |
|
| 165 | ||
| 166 | public function count($columns = ['*']) |
|
| 167 | { |
|
| 168 | $tags = [str_slug(get_class($this->model))]; |
|
| 169 | $key = str_slug(get_class($this->model)) ."-count"; |
|
| 170 | ||
| 171 | return $this->cache($tags) |
|
| 172 | ->rememberForever($key, function () use ($columns) { |
|
| 173 | return parent::count($columns); |
|
| 174 | }); |
|
| 175 | } |
|
| 176 | ||
| 177 | public function cursor() |
|
| 178 | { |
|
| @@ 177-186 (lines=10) @@ | ||
| 174 | }); |
|
| 175 | } |
|
| 176 | ||
| 177 | public function cursor() |
|
| 178 | { |
|
| 179 | $tags = [str_slug(get_class($this->model))]; |
|
| 180 | $key = str_slug(get_class($this->model)) ."-cursor"; |
|
| 181 | ||
| 182 | return $this->cache($tags) |
|
| 183 | ->rememberForever($key, function () { |
|
| 184 | return collect(parent::cursor()); |
|
| 185 | }); |
|
| 186 | } |
|
| 187 | ||
| 188 | /** |
|
| 189 | * @SuppressWarnings(PHPMD.ShortVariable) |
|
| @@ 224-233 (lines=10) @@ | ||
| 221 | }); |
|
| 222 | } |
|
| 223 | ||
| 224 | public function max($column) |
|
| 225 | { |
|
| 226 | $tags = [str_slug(get_class($this->model))]; |
|
| 227 | $key = str_slug(get_class($this->model)) ."-max_{$column}"; |
|
| 228 | ||
| 229 | return $this->cache($tags) |
|
| 230 | ->rememberForever($key, function () use ($column) { |
|
| 231 | return parent::max($column); |
|
| 232 | }); |
|
| 233 | } |
|
| 234 | ||
| 235 | public function min($column) |
|
| 236 | { |
|
| @@ 235-244 (lines=10) @@ | ||
| 232 | }); |
|
| 233 | } |
|
| 234 | ||
| 235 | public function min($column) |
|
| 236 | { |
|
| 237 | $tags = [str_slug(get_class($this->model))]; |
|
| 238 | $key = str_slug(get_class($this->model)) ."-min_{$column}"; |
|
| 239 | ||
| 240 | return $this->cache($tags) |
|
| 241 | ->rememberForever($key, function () use ($column) { |
|
| 242 | return parent::min($column); |
|
| 243 | }); |
|
| 244 | } |
|
| 245 | ||
| 246 | public function pluck($column, $key = null) |
|
| 247 | { |
|
| @@ 261-270 (lines=10) @@ | ||
| 258 | }); |
|
| 259 | } |
|
| 260 | ||
| 261 | public function sum($column) |
|
| 262 | { |
|
| 263 | $tags = [str_slug(get_class($this->model))]; |
|
| 264 | $key = str_slug(get_class($this->model)) ."-sum_{$column}"; |
|
| 265 | ||
| 266 | return $this->cache($tags) |
|
| 267 | ->rememberForever($key, function () use ($column) { |
|
| 268 | return parent::sum($column); |
|
| 269 | }); |
|
| 270 | } |
|
| 271 | } |
|
| 272 | ||