@@ 218-235 (lines=18) @@ | ||
215 | return $result; |
|
216 | } |
|
217 | ||
218 | public function first($columns = ['*']) |
|
219 | { |
|
220 | $tags = $this->getCacheTags(); |
|
221 | $key = $this->getCacheKey($columns) . '-first'; |
|
222 | ||
223 | if ($this->isCaching()) { |
|
224 | return parent::first($columns); |
|
225 | } |
|
226 | ||
227 | $cachingFlag = $this->setCachingFlag(); |
|
228 | $result = $this->cache($tags) |
|
229 | ->rememberForever($key, function () use ($columns) { |
|
230 | return parent::first($columns); |
|
231 | }); |
|
232 | $this->clearCachingFlag($cachingFlag); |
|
233 | ||
234 | return $result; |
|
235 | } |
|
236 | ||
237 | public function get($columns = ['*']) |
|
238 | { |
|
@@ 237-254 (lines=18) @@ | ||
234 | return $result; |
|
235 | } |
|
236 | ||
237 | public function get($columns = ['*']) |
|
238 | { |
|
239 | $tags = $this->getCacheTags(); |
|
240 | $key = $this->getCacheKey($columns); |
|
241 | ||
242 | if ($this->isCaching()) { |
|
243 | return parent::get($columns); |
|
244 | } |
|
245 | ||
246 | $cachingFlag = $this->setCachingFlag(); |
|
247 | $result = $this->cache($tags) |
|
248 | ->rememberForever($key, function () use ($columns) { |
|
249 | return parent::get($columns); |
|
250 | }); |
|
251 | $this->clearCachingFlag($cachingFlag); |
|
252 | ||
253 | return $result; |
|
254 | } |
|
255 | ||
256 | public function max($column) |
|
257 | { |