revert product changes

This commit is contained in:
2026-05-25 20:55:05 +03:30
parent 6ade379944
commit 98d62dd5d3
2 changed files with 62 additions and 207 deletions
+3 -16
View File
@@ -6,27 +6,14 @@ use App\Models\Setting;
class ConfigService
{
public function Config($name, $default = false)
public function Config($name)
{
$value = Setting::where('key', $name)->value('value');
return $value !== null ? $value : $default;
}
public function ConfigBool(string $name, bool $default = false): bool
{
$value = $this->Config($name, null);
if ($value === null) {
return $default;
}
return in_array(strtolower(trim((string) $value)), ['1', 'true', 'yes', 'on'], true);
return Setting::where('key', $name)->value('value') ?? false;
}
public function UpdateConfig($name, $value)
{
return Setting::updateOrCreate(
return \App\Models\Setting::updateOrCreate(
['key' => $name],
['value' => $value]
);