@@ -54,23 +54,23 @@ discard block |
||
| 54 | 54 | $key = str_slug(get_class($this->model)); |
| 55 | 55 | |
| 56 | 56 | if ($ids) { |
| 57 | - $key .= '_' . (is_array($ids) |
|
| 57 | + $key .= '_'.(is_array($ids) |
|
| 58 | 58 | ? implode('_', $ids) |
| 59 | 59 | : $ids); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | if ($columns !== ['*']) { |
| 63 | - $key .= '_' . implode('_', $columns); |
|
| 63 | + $key .= '_'.implode('_', $columns); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - $key .= collect($this->query->wheres)->reduce(function ($carry, $where) { |
|
| 66 | + $key .= collect($this->query->wheres)->reduce(function($carry, $where) { |
|
| 67 | 67 | $value = $where['value'] ?? implode('_', $where['values']) ?? ''; |
| 68 | 68 | |
| 69 | 69 | return "{$carry}-{$where['column']}_{$value}"; |
| 70 | 70 | }); |
| 71 | 71 | |
| 72 | 72 | if (collect($this->eagerLoad)->isNotEmpty()) { |
| 73 | - $key .= '-' . implode('-', collect($this->eagerLoad)->keys()->toArray()); |
|
| 73 | + $key .= '-'.implode('-', collect($this->eagerLoad)->keys()->toArray()); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | if ($this->query->offset) { |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | protected function getCacheTags() : array |
| 88 | 88 | { |
| 89 | 89 | return collect($this->eagerLoad)->keys() |
| 90 | - ->map(function ($name) { |
|
| 90 | + ->map(function($name) { |
|
| 91 | 91 | return str_slug(get_class( |
| 92 | 92 | $this->model |
| 93 | 93 | ->{$name}() |
@@ -103,10 +103,10 @@ discard block |
||
| 103 | 103 | public function avg($column) |
| 104 | 104 | { |
| 105 | 105 | $tags = [str_slug(get_class($this->model))]; |
| 106 | - $key = str_slug(get_class($this->model)) ."-avg_{$column}"; |
|
| 106 | + $key = str_slug(get_class($this->model))."-avg_{$column}"; |
|
| 107 | 107 | |
| 108 | 108 | return $this->cache($tags) |
| 109 | - ->rememberForever($key, function () use ($column) { |
|
| 109 | + ->rememberForever($key, function() use ($column) { |
|
| 110 | 110 | return parent::avg($column); |
| 111 | 111 | }); |
| 112 | 112 | } |
@@ -114,10 +114,10 @@ discard block |
||
| 114 | 114 | public function count($columns = ['*']) |
| 115 | 115 | { |
| 116 | 116 | $tags = [str_slug(get_class($this->model))]; |
| 117 | - $key = str_slug(get_class($this->model)) ."-count"; |
|
| 117 | + $key = str_slug(get_class($this->model))."-count"; |
|
| 118 | 118 | |
| 119 | 119 | return $this->cache($tags) |
| 120 | - ->rememberForever($key, function () use ($columns) { |
|
| 120 | + ->rememberForever($key, function() use ($columns) { |
|
| 121 | 121 | return parent::count($columns); |
| 122 | 122 | }); |
| 123 | 123 | } |
@@ -125,10 +125,10 @@ discard block |
||
| 125 | 125 | public function cursor() |
| 126 | 126 | { |
| 127 | 127 | $tags = [str_slug(get_class($this->model))]; |
| 128 | - $key = str_slug(get_class($this->model)) ."-cursor"; |
|
| 128 | + $key = str_slug(get_class($this->model))."-cursor"; |
|
| 129 | 129 | |
| 130 | 130 | return $this->cache($tags) |
| 131 | - ->rememberForever($key, function () { |
|
| 131 | + ->rememberForever($key, function() { |
|
| 132 | 132 | return collect(parent::cursor()); |
| 133 | 133 | }); |
| 134 | 134 | } |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | $key = $this->getCacheKey($columns, $id); |
| 143 | 143 | |
| 144 | 144 | return $this->cache($tags) |
| 145 | - ->rememberForever($key, function () use ($id, $columns) { |
|
| 145 | + ->rememberForever($key, function() use ($id, $columns) { |
|
| 146 | 146 | return parent::find($id, $columns); |
| 147 | 147 | }); |
| 148 | 148 | } |
@@ -150,10 +150,10 @@ discard block |
||
| 150 | 150 | public function first($columns = ['*']) |
| 151 | 151 | { |
| 152 | 152 | $tags = $this->getCacheTags(); |
| 153 | - $key = $this->getCacheKey($columns) . '-first'; |
|
| 153 | + $key = $this->getCacheKey($columns).'-first'; |
|
| 154 | 154 | |
| 155 | 155 | return $this->cache($tags) |
| 156 | - ->rememberForever($key, function () use ($columns) { |
|
| 156 | + ->rememberForever($key, function() use ($columns) { |
|
| 157 | 157 | return parent::first($columns); |
| 158 | 158 | }); |
| 159 | 159 | } |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | $key = $this->getCacheKey($columns); |
| 165 | 165 | |
| 166 | 166 | return $this->cache($tags) |
| 167 | - ->rememberForever($key, function () use ($columns) { |
|
| 167 | + ->rememberForever($key, function() use ($columns) { |
|
| 168 | 168 | return parent::get($columns); |
| 169 | 169 | }); |
| 170 | 170 | } |
@@ -172,10 +172,10 @@ discard block |
||
| 172 | 172 | public function max($column) |
| 173 | 173 | { |
| 174 | 174 | $tags = [str_slug(get_class($this->model))]; |
| 175 | - $key = str_slug(get_class($this->model)) ."-max_{$column}"; |
|
| 175 | + $key = str_slug(get_class($this->model))."-max_{$column}"; |
|
| 176 | 176 | |
| 177 | 177 | return $this->cache($tags) |
| 178 | - ->rememberForever($key, function () use ($column) { |
|
| 178 | + ->rememberForever($key, function() use ($column) { |
|
| 179 | 179 | return parent::max($column); |
| 180 | 180 | }); |
| 181 | 181 | } |
@@ -183,10 +183,10 @@ discard block |
||
| 183 | 183 | public function min($column) |
| 184 | 184 | { |
| 185 | 185 | $tags = [str_slug(get_class($this->model))]; |
| 186 | - $key = str_slug(get_class($this->model)) ."-min_{$column}"; |
|
| 186 | + $key = str_slug(get_class($this->model))."-min_{$column}"; |
|
| 187 | 187 | |
| 188 | 188 | return $this->cache($tags) |
| 189 | - ->rememberForever($key, function () use ($column) { |
|
| 189 | + ->rememberForever($key, function() use ($column) { |
|
| 190 | 190 | return parent::min($column); |
| 191 | 191 | }); |
| 192 | 192 | } |
@@ -194,14 +194,14 @@ discard block |
||
| 194 | 194 | public function pluck($column, $key = null) |
| 195 | 195 | { |
| 196 | 196 | $tags = $this->getCacheTags(); |
| 197 | - $cacheKey = $this->getCacheKey([$column]) . "-pluck_{$column}"; |
|
| 197 | + $cacheKey = $this->getCacheKey([$column])."-pluck_{$column}"; |
|
| 198 | 198 | |
| 199 | 199 | if ($key) { |
| 200 | 200 | $cacheKey .= "_{$key}"; |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | return $this->cache($tags) |
| 204 | - ->rememberForever($cacheKey, function () use ($column, $key) { |
|
| 204 | + ->rememberForever($cacheKey, function() use ($column, $key) { |
|
| 205 | 205 | return parent::pluck($column, $key); |
| 206 | 206 | }); |
| 207 | 207 | } |
@@ -209,10 +209,10 @@ discard block |
||
| 209 | 209 | public function sum($column) |
| 210 | 210 | { |
| 211 | 211 | $tags = [str_slug(get_class($this->model))]; |
| 212 | - $key = str_slug(get_class($this->model)) ."-sum_{$column}"; |
|
| 212 | + $key = str_slug(get_class($this->model))."-sum_{$column}"; |
|
| 213 | 213 | |
| 214 | 214 | return $this->cache($tags) |
| 215 | - ->rememberForever($key, function () use ($column) { |
|
| 215 | + ->rememberForever($key, function() use ($column) { |
|
| 216 | 216 | return parent::sum($column); |
| 217 | 217 | }); |
| 218 | 218 | } |