| @@ 103-112 (lines=10) @@ | ||
| 100 | ->toArray(); |
|
| 101 | } |
|
| 102 | ||
| 103 | public function avg($column) |
|
| 104 | { |
|
| 105 | $tags = [str_slug(get_class($this->model))]; |
|
| 106 | $key = str_slug(get_class($this->model)) ."-avg_{$column}"; |
|
| 107 | ||
| 108 | return $this->cache($tags) |
|
| 109 | ->rememberForever($key, function () use ($column) { |
|
| 110 | return parent::avg($column); |
|
| 111 | }); |
|
| 112 | } |
|
| 113 | ||
| 114 | public function count($columns = ['*']) |
|
| 115 | { |
|
| @@ 114-123 (lines=10) @@ | ||
| 111 | }); |
|
| 112 | } |
|
| 113 | ||
| 114 | public function count($columns = ['*']) |
|
| 115 | { |
|
| 116 | $tags = [str_slug(get_class($this->model))]; |
|
| 117 | $key = str_slug(get_class($this->model)) ."-count"; |
|
| 118 | ||
| 119 | return $this->cache($tags) |
|
| 120 | ->rememberForever($key, function () use ($columns) { |
|
| 121 | return parent::count($columns); |
|
| 122 | }); |
|
| 123 | } |
|
| 124 | ||
| 125 | public function cursor() |
|
| 126 | { |
|
| @@ 125-134 (lines=10) @@ | ||
| 122 | }); |
|
| 123 | } |
|
| 124 | ||
| 125 | public function cursor() |
|
| 126 | { |
|
| 127 | $tags = [str_slug(get_class($this->model))]; |
|
| 128 | $key = str_slug(get_class($this->model)) ."-cursor"; |
|
| 129 | ||
| 130 | return $this->cache($tags) |
|
| 131 | ->rememberForever($key, function () { |
|
| 132 | return collect(parent::cursor()); |
|
| 133 | }); |
|
| 134 | } |
|
| 135 | ||
| 136 | /** |
|
| 137 | * @SuppressWarnings(PHPMD.ShortVariable) |
|
| @@ 172-181 (lines=10) @@ | ||
| 169 | }); |
|
| 170 | } |
|
| 171 | ||
| 172 | public function max($column) |
|
| 173 | { |
|
| 174 | $tags = [str_slug(get_class($this->model))]; |
|
| 175 | $key = str_slug(get_class($this->model)) ."-max_{$column}"; |
|
| 176 | ||
| 177 | return $this->cache($tags) |
|
| 178 | ->rememberForever($key, function () use ($column) { |
|
| 179 | return parent::max($column); |
|
| 180 | }); |
|
| 181 | } |
|
| 182 | ||
| 183 | public function min($column) |
|
| 184 | { |
|
| @@ 183-192 (lines=10) @@ | ||
| 180 | }); |
|
| 181 | } |
|
| 182 | ||
| 183 | public function min($column) |
|
| 184 | { |
|
| 185 | $tags = [str_slug(get_class($this->model))]; |
|
| 186 | $key = str_slug(get_class($this->model)) ."-min_{$column}"; |
|
| 187 | ||
| 188 | return $this->cache($tags) |
|
| 189 | ->rememberForever($key, function () use ($column) { |
|
| 190 | return parent::min($column); |
|
| 191 | }); |
|
| 192 | } |
|
| 193 | ||
| 194 | public function pluck($column, $key = null) |
|
| 195 | { |
|
| @@ 209-218 (lines=10) @@ | ||
| 206 | }); |
|
| 207 | } |
|
| 208 | ||
| 209 | public function sum($column) |
|
| 210 | { |
|
| 211 | $tags = [str_slug(get_class($this->model))]; |
|
| 212 | $key = str_slug(get_class($this->model)) ."-sum_{$column}"; |
|
| 213 | ||
| 214 | return $this->cache($tags) |
|
| 215 | ->rememberForever($key, function () use ($column) { |
|
| 216 | return parent::sum($column); |
|
| 217 | }); |
|
| 218 | } |
|
| 219 | } |
|
| 220 | ||