@@ 55-64 (lines=10) @@ | ||
52 | /** |
|
53 | * @SuppressWarnings(PHPMD.ShortVariable) |
|
54 | */ |
|
55 | public function find($id, $columns = ['*']) |
|
56 | { |
|
57 | $tag = str_slug(get_class($this->model)); |
|
58 | $key = "{$tag}_{$id}_" . implode('_', $columns); |
|
59 | ||
60 | return $this->cache([$tag]) |
|
61 | ->rememberForever($key, function () use ($id, $columns) { |
|
62 | return parent::find($id, $columns); |
|
63 | }); |
|
64 | } |
|
65 | ||
66 | public function count($columns = '*') |
|
67 | { |
|
@@ 66-75 (lines=10) @@ | ||
63 | }); |
|
64 | } |
|
65 | ||
66 | public function count($columns = '*') |
|
67 | { |
|
68 | $tag = str_slug(get_class($this->model)); |
|
69 | $key = "{$tag}_" . implode('_', $columns); |
|
70 | ||
71 | return $this->cache([$tag]) |
|
72 | ->rememberForever($key, function () use ($id, $columns) { |
|
73 | return parent::count($columns); |
|
74 | }); |
|
75 | } |
|
76 | ||
77 | public function first($columns = ['*']) |
|
78 | { |
|
@@ 77-86 (lines=10) @@ | ||
74 | }); |
|
75 | } |
|
76 | ||
77 | public function first($columns = ['*']) |
|
78 | { |
|
79 | $tag = str_slug(get_class($this->model)); |
|
80 | $key = "{$tag}_" . implode('_', $columns); |
|
81 | ||
82 | return $this->cache([$tag]) |
|
83 | ->rememberForever($key, function () use ($id, $columns) { |
|
84 | return parent::first($columns); |
|
85 | }); |
|
86 | } |
|
87 | ||
88 | public function get($columns = ['*']) |
|
89 | { |