- setting.require_complete_profile (mặc định bật), trả qua GET v1/setting - bulkDeleteServices xoá mềm invoice nâng cấp + order mồ côi (ServiceOrderRecorder::discardOrder) - createService trỏ dịch vụ sang order mới thì bỏ order cũ - SyncVirtualMachine cập nhật name + gắn virtual_machine_id cho module_vmware Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
34 lines
783 B
PHP
34 lines
783 B
PHP
<?php
|
|
|
|
namespace App\Support;
|
|
|
|
use App\Models\Setting;
|
|
|
|
final class PublicSetting
|
|
{
|
|
public const FIELDS = ['title', 'company', 'logo', 'favi_icon', 'brand_color'];
|
|
|
|
/**
|
|
* @return array<string, string>
|
|
*/
|
|
public static function values(): array
|
|
{
|
|
$value = self::raw();
|
|
|
|
return array_map(fn (string $field) => (string) ($value[$field] ?? ''), array_combine(self::FIELDS, self::FIELDS));
|
|
}
|
|
|
|
public static function requireCompleteProfile(): bool
|
|
{
|
|
return (bool) (self::raw()['require_complete_profile'] ?? true);
|
|
}
|
|
|
|
/**
|
|
* @return array<string, mixed>
|
|
*/
|
|
private static function raw(): array
|
|
{
|
|
return json_decode((string) Setting::where('key', 'setting')->value('value'), true) ?: [];
|
|
}
|
|
}
|