Files
boursecu_server/app/Services/ConfigService.php
T

18 lines
331 B
PHP
Raw Normal View History

2026-05-24 13:56:33 +03:30
<?php
namespace App\Services;
2026-05-24 19:22:09 +03:30
use App\Models\Setting;
2026-05-24 13:56:33 +03:30
class ConfigService
{
2026-05-24 19:22:09 +03:30
public function Config($name)
2026-05-24 13:56:33 +03:30
{
2026-05-24 19:22:09 +03:30
return Setting::where('key', $name)->value('value') ?? false;
2026-05-24 13:56:33 +03:30
}
2026-05-24 19:22:09 +03:30
public function UpdateConfig($name, $value)
2026-05-24 13:56:33 +03:30
{
2026-05-24 19:22:09 +03:30
return Setting::where('key', $name)->update(['value' => $value]);
2026-05-24 13:56:33 +03:30
}
2026-05-24 19:22:09 +03:30
}