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