first&last
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?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 : [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user