src/Commands/SettingsCache.php 1 location
|
@@ 53-61 (lines=9) @@
|
| 50 |
|
|
| 51 |
|
$model = $this->option('model'); |
| 52 |
|
|
| 53 |
|
if (isset($model)) { |
| 54 |
|
(new $model)->all()->each(function ($user) use ($duration) { |
| 55 |
|
$user->allSettings()->each(function ($value, $key) use ($user, $duration) { |
| 56 |
|
$cache_key = $user->settingsCacheKey($key); |
| 57 |
|
|
| 58 |
|
Cache::put($cache_key, $value, $duration); |
| 59 |
|
}); |
| 60 |
|
}); |
| 61 |
|
} |
| 62 |
|
|
| 63 |
|
$this->info('Cached all settings'); |
| 64 |
|
} |
src/Commands/SettingsClear.php 1 location
|
@@ 52-60 (lines=9) @@
|
| 49 |
|
|
| 50 |
|
$model = $this->option('model'); |
| 51 |
|
|
| 52 |
|
if (isset($model)) { |
| 53 |
|
(new $model)->all()->each(function ($user) { |
| 54 |
|
$user->allSettings()->each(function ($value, $key) use ($user) { |
| 55 |
|
$cache_key = $user->settingsCacheKey($key); |
| 56 |
|
|
| 57 |
|
Cache::forget($cache_key); |
| 58 |
|
}); |
| 59 |
|
}); |
| 60 |
|
} |
| 61 |
|
|
| 62 |
|
$this->info('Cleared settings cache.'); |
| 63 |
|
} |