@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | public function avg($column) |
11 | 11 | { |
12 | 12 | return $this->cache($this->makeCacheTags($this)) |
13 | - ->rememberForever($this->makeCacheKey() . "-avg_{$column}", function () use ($column) { |
|
13 | + ->rememberForever($this->makeCacheKey()."-avg_{$column}", function() use ($column) { |
|
14 | 14 | return parent::avg($column); |
15 | 15 | }); |
16 | 16 | } |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | public function count($columns = ['*']) |
19 | 19 | { |
20 | 20 | return $this->cache($this->makeCacheTags($this)) |
21 | - ->rememberForever($this->makeCacheKey() . "-count", function () use ($columns) { |
|
21 | + ->rememberForever($this->makeCacheKey()."-count", function() use ($columns) { |
|
22 | 22 | return parent::count($columns); |
23 | 23 | }); |
24 | 24 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | public function cursor() |
27 | 27 | { |
28 | 28 | return $this->cache($this->makeCacheTags($this)) |
29 | - ->rememberForever($this->makeCacheKey() . "-cursor", function () { |
|
29 | + ->rememberForever($this->makeCacheKey()."-cursor", function() { |
|
30 | 30 | return collect(parent::cursor()); |
31 | 31 | }); |
32 | 32 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | public function find($id, $columns = ['*']) |
38 | 38 | { |
39 | 39 | return $this->cache($this->makeCacheTags($this)) |
40 | - ->rememberForever($this->makeCacheKey($columns, $id), function () use ($id, $columns) { |
|
40 | + ->rememberForever($this->makeCacheKey($columns, $id), function() use ($id, $columns) { |
|
41 | 41 | return parent::find($id, $columns); |
42 | 42 | }); |
43 | 43 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | public function first($columns = ['*']) |
46 | 46 | { |
47 | 47 | return $this->cache($this->makeCacheTags($this)) |
48 | - ->rememberForever($this->makeCacheKey($columns) . '-first', function () use ($columns) { |
|
48 | + ->rememberForever($this->makeCacheKey($columns).'-first', function() use ($columns) { |
|
49 | 49 | return parent::first($columns); |
50 | 50 | }); |
51 | 51 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | public function get($columns = ['*']) |
54 | 54 | { |
55 | 55 | return $this->cache($this->makeCacheTags($this)) |
56 | - ->rememberForever($this->makeCacheKey($columns), function () use ($columns) { |
|
56 | + ->rememberForever($this->makeCacheKey($columns), function() use ($columns) { |
|
57 | 57 | return parent::get($columns); |
58 | 58 | }); |
59 | 59 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | public function max($column) |
62 | 62 | { |
63 | 63 | return $this->cache($this->makeCacheTags($this)) |
64 | - ->rememberForever($this->makeCacheKey() . "-max_{$column}", function () use ($column) { |
|
64 | + ->rememberForever($this->makeCacheKey()."-max_{$column}", function() use ($column) { |
|
65 | 65 | return parent::max($column); |
66 | 66 | }); |
67 | 67 | } |
@@ -69,21 +69,21 @@ discard block |
||
69 | 69 | public function min($column) |
70 | 70 | { |
71 | 71 | return $this->cache($this->makeCacheTags($this)) |
72 | - ->rememberForever($this->makeCacheKey() . "-min_{$column}", function () use ($column) { |
|
72 | + ->rememberForever($this->makeCacheKey()."-min_{$column}", function() use ($column) { |
|
73 | 73 | return parent::min($column); |
74 | 74 | }); |
75 | 75 | } |
76 | 76 | |
77 | 77 | public function pluck($column, $key = null) |
78 | 78 | { |
79 | - $cacheKey = $this->makeCacheKey([$column]) . "-pluck_{$column}"; |
|
79 | + $cacheKey = $this->makeCacheKey([$column])."-pluck_{$column}"; |
|
80 | 80 | |
81 | 81 | if ($key) { |
82 | 82 | $cacheKey .= "_{$key}"; |
83 | 83 | } |
84 | 84 | |
85 | 85 | return $this->cache($this->makeCacheTags($this)) |
86 | - ->rememberForever($cacheKey, function () use ($column, $key) { |
|
86 | + ->rememberForever($cacheKey, function() use ($column, $key) { |
|
87 | 87 | return parent::pluck($column, $key); |
88 | 88 | }); |
89 | 89 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | public function sum($column) |
92 | 92 | { |
93 | 93 | return $this->cache($this->makeCacheTags($this)) |
94 | - ->rememberForever($this->makeCacheKey() . "-sum_{$column}", function () use ($column) { |
|
94 | + ->rememberForever($this->makeCacheKey()."-sum_{$column}", function() use ($column) { |
|
95 | 95 | return parent::sum($column); |
96 | 96 | }); |
97 | 97 | } |
@@ -8,10 +8,10 @@ |
||
8 | 8 | { |
9 | 9 | return collect($this->eagerLoad) |
10 | 10 | ->keys() |
11 | - ->map(function ($relationName) { |
|
11 | + ->map(function($relationName) { |
|
12 | 12 | $relation = collect(explode('.', $relationName)) |
13 | - ->reduce(function ($carry, $name) { |
|
14 | - if (! $carry) { |
|
13 | + ->reduce(function($carry, $name) { |
|
14 | + if (!$carry) { |
|
15 | 15 | $carry = $this->model; |
16 | 16 | } |
17 | 17 |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | protected function getLimitClause() : string |
27 | 27 | { |
28 | - if (! $this->query->limit) { |
|
28 | + if (!$this->query->limit) { |
|
29 | 29 | return ''; |
30 | 30 | } |
31 | 31 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | |
40 | 40 | protected function getOffsetClause() : string |
41 | 41 | { |
42 | - if (! $this->query->offset) { |
|
42 | + if (!$this->query->offset) { |
|
43 | 43 | return ''; |
44 | 44 | } |
45 | 45 | |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | { |
51 | 51 | $orders = collect($this->query->orders); |
52 | 52 | |
53 | - return $orders->reduce(function($carry, $order){ |
|
54 | - return $carry . '_orderBy_' . $order['column'] . '_' . $order['direction']; |
|
53 | + return $orders->reduce(function($carry, $order) { |
|
54 | + return $carry.'_orderBy_'.$order['column'].'_'.$order['direction']; |
|
55 | 55 | }) |
56 | 56 | ?: ''; |
57 | 57 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | return ''; |
63 | 63 | } |
64 | 64 | |
65 | - return '_' . implode('_', $columns); |
|
65 | + return '_'.implode('_', $columns); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | protected function getTypeClause($where) : string |
@@ -75,16 +75,16 @@ discard block |
||
75 | 75 | protected function getValuesClause(array $where = null) : string |
76 | 76 | { |
77 | 77 | return is_array(array_get($where, 'values')) |
78 | - ? '_' . implode('_', $where['values']) |
|
78 | + ? '_'.implode('_', $where['values']) |
|
79 | 79 | : ''; |
80 | 80 | } |
81 | 81 | |
82 | 82 | protected function getWhereClauses(array $wheres = []) : string |
83 | 83 | { |
84 | 84 | return $this->getWheres($wheres) |
85 | - ->reduce(function ($carry, $where) { |
|
85 | + ->reduce(function($carry, $where) { |
|
86 | 86 | if (in_array($where['type'], ['Exists', 'Nested', 'NotExists'])) { |
87 | - return '_' . strtolower($where['type']) . $this->getWhereClauses($where['query']->wheres); |
|
87 | + return '_'.strtolower($where['type']).$this->getWhereClauses($where['query']->wheres); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | if ($where['type'] === 'Column') { |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | } |
93 | 93 | |
94 | 94 | if ($where['type'] === 'raw') { |
95 | - return "_{$where['boolean']}_" . str_slug($where['sql']); |
|
95 | + return "_{$where['boolean']}_".str_slug($where['sql']); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | $value = array_get($where, 'value'); |
@@ -123,6 +123,6 @@ discard block |
||
123 | 123 | return ''; |
124 | 124 | } |
125 | 125 | |
126 | - return '-' . implode('-', $eagerLoads->keys()->toArray()); |
|
126 | + return '-'.implode('-', $eagerLoads->keys()->toArray()); |
|
127 | 127 | } |
128 | 128 | } |