v7.0.0-beta.2 release
This commit is contained in:
1 parent
6595fd0eb5
commit
fa8eba7a0d
1165 files changed
+107118
-762127
No files matched your search
+19
-57
@@ -2,71 +2,33 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Concerns\MailTemplateBehavior;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* 코어 메일 템플릿 모델.
|
||||
* [한시적 호환 Shim — 7.0.0-beta.1 → 7.0.0-beta.2 업그레이드 전용]
|
||||
*
|
||||
* 코어 시스템의 메일 템플릿(welcome, reset_password, password_changed)을 관리합니다.
|
||||
* beta.2 에서 알림 시스템 통합(#256)으로 MailTemplate 은 공식 제거되었으나,
|
||||
* 업데이트 중 in-memory 로 실행되는 beta.1 의 `CoreUpdateService::syncCoreMailTemplates()`
|
||||
* 가 `MailTemplate::where()` / `::create()` 를 호출하여 autoload 가 필요하다.
|
||||
*
|
||||
* 본 shim 은 autoload 통과와 최소 Eloquent 쿼리 성공만 제공하며, 업그레이드 종료 시점에
|
||||
* `Upgrade_7_0_0_beta_2::run()` 이 파일과 `mail_templates` 테이블을 함께 제거한다.
|
||||
* beta.3 에서는 저장소에서도 완전히 삭제 예정.
|
||||
*
|
||||
* ※ 본 파일은 비즈니스 로직을 포함하지 않으며, 확장이나 재사용 대상이 아니다.
|
||||
*/
|
||||
class MailTemplate extends Model
|
||||
{
|
||||
use HasFactory, MailTemplateBehavior;
|
||||
|
||||
/** @var array<string, array> 활동 로그 추적 필드 */
|
||||
public static array $activityLogFields = [
|
||||
'subject' => ['label_key' => 'activity_log.fields.subject', 'type' => 'text'],
|
||||
'body' => ['label_key' => 'activity_log.fields.body', 'type' => 'text'],
|
||||
'is_active' => ['label_key' => 'activity_log.fields.is_active', 'type' => 'boolean'],
|
||||
'is_default' => ['label_key' => 'activity_log.fields.is_default', 'type' => 'boolean'],
|
||||
];
|
||||
|
||||
/**
|
||||
* @var string 테이블명
|
||||
*/
|
||||
protected $table = 'mail_templates';
|
||||
|
||||
/**
|
||||
* @var array<string, mixed> 기본 속성 값
|
||||
*/
|
||||
protected $attributes = [
|
||||
'variables' => '[]',
|
||||
protected $guarded = [];
|
||||
|
||||
protected $casts = [
|
||||
'subject' => 'array',
|
||||
'body' => 'array',
|
||||
'variables' => 'array',
|
||||
'user_overrides' => 'array',
|
||||
'is_active' => 'boolean',
|
||||
'is_default' => 'boolean',
|
||||
];
|
||||
|
||||
/**
|
||||
* @var array<int, string> Mass assignable 필드
|
||||
*/
|
||||
protected $fillable = [
|
||||
'type',
|
||||
'subject',
|
||||
'body',
|
||||
'variables',
|
||||
'is_active',
|
||||
'is_default',
|
||||
'user_overrides',
|
||||
'updated_by',
|
||||
];
|
||||
|
||||
/**
|
||||
* @return array<string, string> 타입 캐스팅
|
||||
*/
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'user_overrides' => 'array',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 마지막 수정자를 반환합니다.
|
||||
*
|
||||
* @return BelongsTo User 관계
|
||||
*/
|
||||
public function updater(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'updated_by');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user