'array', ]; /** * 테마가 활성화되어 있는지 확인합니다. * * @return bool 활성화 상태 여부 */ public function isActive(): bool { return $this->status === 'active'; } /** * 코어 테마인지 확인합니다. * * @return bool 코어 테마 여부 */ public function isCore(): bool { return $this->type === 'core'; } /** * 모듈 테마인지 확인합니다. * * @return bool 모듈 테마 여부 */ public function isModule(): bool { return $this->type === 'module'; } /** * 관리자용 테마인지 확인합니다. * * @return bool 관리자용 테마 여부 */ public function isAdmin(): bool { return $this->target === 'admin'; } /** * 사용자용 테마인지 확인합니다. * * @return bool 사용자용 테마 여부 */ public function isUser(): bool { return $this->target === 'user'; } /** * 테마의 파일 시스템 경로를 반환합니다. * * @return string 테마 파일 경로 */ public function getPath(): string { $basePath = resource_path('themes'); if ($this->isCore()) { return $basePath . '/core/' . $this->target . '/' . $this->name; } return $basePath . '/modules/' . $this->module_name . '/' . $this->target . '/' . $this->name; } /** * 테마를 생성한 사용자와의 관계를 정의합니다. * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function creator() { return $this->belongsTo(User::class, 'created_by'); } }