Files
AirService_potyk/app/Services/SettingsService.php
T
2026-03-20 15:47:17 +05:00

31 lines
644 B
PHP

<?php
namespace App\Services;
use App\Models\Setting;
class SettingsService
{
public function get(string $key, mixed $default = null): mixed
{
return Setting::getValue($key, $default);
}
public function set(string $key, mixed $value, string $type = 'string'): Setting
{
return Setting::setValue($key, $value, $type);
}
public function defaultSlaHours(): int
{
return (int) $this->get('default_sla_hours', 24);
}
public function emailNotifications(): array
{
$value = $this->get('email_notifications', []);
return is_array($value) ? $value : [];
}
}