Publication initiale de RelaisSMS : documentation et sources nettoyees

This commit is contained in:
2026-10-21 09:29:39 +02:00
commit ac186b03b1
158 changed files with 24818 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Model;
#[Fillable(['key', 'value', 'type'])]
class AppSetting extends Model
{
public static function string(string $key, string $default = ''): string
{
$setting = self::query()->where('key', $key)->first();
if ($setting === null) {
$configured = config('relais_sms.default_settings.'.$key);
return is_string($configured) ? $configured : $default;
}
return (string) $setting->value;
}
public static function putString(string $key, string $value): void
{
self::query()->updateOrCreate(
['key' => $key],
[
'value' => $value,
'type' => 'string',
],
);
}
}