|
|
@ -4,6 +4,7 @@ namespace App\Services;
|
|
|
|
|
|
|
|
|
|
|
|
use App\Models\ConfigCache as ConfigCacheModel;
|
|
|
|
use App\Models\ConfigCache as ConfigCacheModel;
|
|
|
|
use Cache;
|
|
|
|
use Cache;
|
|
|
|
|
|
|
|
use Illuminate\Database\QueryException;
|
|
|
|
|
|
|
|
|
|
|
|
class ConfigCacheService
|
|
|
|
class ConfigCacheService
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -25,8 +26,8 @@ class ConfigCacheService
|
|
|
|
return config($key);
|
|
|
|
return config($key);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
return Cache::remember($cacheKey, $ttl, function () use ($key) {
|
|
|
|
return Cache::remember($cacheKey, $ttl, function () use ($key) {
|
|
|
|
|
|
|
|
|
|
|
|
$allowed = [
|
|
|
|
$allowed = [
|
|
|
|
'app.name',
|
|
|
|
'app.name',
|
|
|
|
'app.short_description',
|
|
|
|
'app.short_description',
|
|
|
@ -175,6 +176,9 @@ class ConfigCacheService
|
|
|
|
|
|
|
|
|
|
|
|
return $v;
|
|
|
|
return $v;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
} catch (Exception | QueryException $e) {
|
|
|
|
|
|
|
|
return config($key);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static function put($key, $val)
|
|
|
|
public static function put($key, $val)
|
|
|
|