31 lines
644 B
PHP
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 : [];
|
|
}
|
|
}
|