update deploy

This commit is contained in:
bulut
2026-03-27 10:41:54 +03:00
parent 69d19c0176
commit 6f6448aa06
422 changed files with 37956 additions and 0 deletions

54
app/Models/Setting.php Normal file
View File

@@ -0,0 +1,54 @@
<?php
namespace App\Models;
use App\Enums\SettingGroup;
use App\Enums\SettingType;
use Illuminate\Database\Eloquent\Model;
class Setting extends Model
{
/**
* Keys that should never appear in public API responses.
*
* @var list<string>
*/
public const SENSITIVE_KEY_PATTERNS = ['_key', '_secret', '_password'];
/**
* @var list<string>
*/
protected $fillable = [
'group',
'key',
'value',
'type',
'label',
'order_index',
'is_public',
];
/**
* @return array<string, string>
*/
protected function casts(): array
{
return [
'group' => SettingGroup::class,
'type' => SettingType::class,
'is_public' => 'boolean',
'order_index' => 'integer',
];
}
public function isSensitive(): bool
{
foreach (self::SENSITIVE_KEY_PATTERNS as $pattern) {
if (str_contains($this->key, $pattern)) {
return true;
}
}
return false;
}
}