@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | ->make("config") |
45 | 45 | ->get("laravel-model-caching.enabled"); |
46 | 46 | |
47 | - if (! $cacheIsEnabled) { |
|
47 | + if (!$cacheIsEnabled) { |
|
48 | 48 | return parent::all($columns); |
49 | 49 | } |
50 | 50 | |
@@ -54,22 +54,22 @@ discard block |
||
54 | 54 | $key = $instance->makeCacheKey(); |
55 | 55 | |
56 | 56 | return $instance->cache($tags) |
57 | - ->rememberForever($key, function () use ($columns) { |
|
57 | + ->rememberForever($key, function() use ($columns) { |
|
58 | 58 | return parent::all($columns); |
59 | 59 | }); |
60 | 60 | } |
61 | 61 | |
62 | 62 | public static function bootCachable() |
63 | 63 | { |
64 | - static::created(function ($instance) { |
|
64 | + static::created(function($instance) { |
|
65 | 65 | $instance->checkCooldownAndFlushAfterPersisting($instance); |
66 | 66 | }); |
67 | 67 | |
68 | - static::deleted(function ($instance) { |
|
68 | + static::deleted(function($instance) { |
|
69 | 69 | $instance->checkCooldownAndFlushAfterPersisting($instance); |
70 | 70 | }); |
71 | 71 | |
72 | - static::saved(function ($instance) { |
|
72 | + static::saved(function($instance) { |
|
73 | 73 | $instance->checkCooldownAndFlushAfterPersisting($instance); |
74 | 74 | }); |
75 | 75 | |
@@ -78,15 +78,15 @@ discard block |
||
78 | 78 | // $instance->checkCooldownAndFlushAfterPersisting($instance); |
79 | 79 | // }); |
80 | 80 | |
81 | - static::pivotAttached(function ($instance, $secondInstance, $relationship) { |
|
81 | + static::pivotAttached(function($instance, $secondInstance, $relationship) { |
|
82 | 82 | $instance->checkCooldownAndFlushAfterPersisting($instance, $relationship); |
83 | 83 | }); |
84 | 84 | |
85 | - static::pivotDetached(function ($instance, $secondInstance, $relationship) { |
|
85 | + static::pivotDetached(function($instance, $secondInstance, $relationship) { |
|
86 | 86 | $instance->checkCooldownAndFlushAfterPersisting($instance, $relationship); |
87 | 87 | }); |
88 | 88 | |
89 | - static::pivotUpdated(function ($instance, $secondInstance, $relationship) { |
|
89 | + static::pivotUpdated(function($instance, $secondInstance, $relationship) { |
|
90 | 90 | $instance->checkCooldownAndFlushAfterPersisting($instance, $relationship); |
91 | 91 | }); |
92 | 92 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | |
103 | 103 | public function newEloquentBuilder($query) |
104 | 104 | { |
105 | - if (! $this->isCachable()) { |
|
105 | + if (!$this->isCachable()) { |
|
106 | 106 | $this->isCachable = false; |
107 | 107 | |
108 | 108 | return new EloquentBuilder($query); |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | EloquentBuilder $query, |
162 | 162 | int $seconds = null |
163 | 163 | ) : EloquentBuilder { |
164 | - if (! $seconds) { |
|
164 | + if (!$seconds) { |
|
165 | 165 | $seconds = $this->cacheCooldownSeconds; |
166 | 166 | } |
167 | 167 | |
@@ -170,13 +170,13 @@ discard block |
||
170 | 170 | $cacheKey = "{$cachePrefix}:{$modelClassName}-cooldown:seconds"; |
171 | 171 | |
172 | 172 | $this->cache() |
173 | - ->rememberForever($cacheKey, function () use ($seconds) { |
|
173 | + ->rememberForever($cacheKey, function() use ($seconds) { |
|
174 | 174 | return $seconds; |
175 | 175 | }); |
176 | 176 | |
177 | 177 | $cacheKey = "{$cachePrefix}:{$modelClassName}-cooldown:invalidated-at"; |
178 | 178 | $this->cache() |
179 | - ->rememberForever($cacheKey, function () { |
|
179 | + ->rememberForever($cacheKey, function() { |
|
180 | 180 | return (new Carbon)->now(); |
181 | 181 | }); |
182 | 182 |
@@ -11,7 +11,7 @@ |
||
11 | 11 | |
12 | 12 | public function boot() |
13 | 13 | { |
14 | - $configPath = __DIR__ . '/../../config/laravel-model-caching.php'; |
|
14 | + $configPath = __DIR__.'/../../config/laravel-model-caching.php'; |
|
15 | 15 | $this->mergeConfigFrom($configPath, 'laravel-model-caching'); |
16 | 16 | $this->commands([ |
17 | 17 | Clear::class, |