- 문서양식 섹션 이미지를 file_id 기반 R2 프록시 URL로 변경 - getSectionImageUrl, _previewImageUrl에 file_id 우선 처리 추가 - 서버사이드 Blade(print, show)도 file_id 기반 URL 생성 - DocumentTemplateSection 모델에 file_id fillable 추가 - 업로드 응답에 file_id 반환, 복제 시 file_id 복사
38 lines
825 B
PHP
38 lines
825 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
class DocumentTemplateSection extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'template_id',
|
|
'title',
|
|
'description',
|
|
'image_path',
|
|
'file_id',
|
|
'sort_order',
|
|
];
|
|
|
|
protected $casts = [
|
|
'sort_order' => 'integer',
|
|
];
|
|
|
|
public function template(): BelongsTo
|
|
{
|
|
return $this->belongsTo(DocumentTemplate::class, 'template_id');
|
|
}
|
|
|
|
public function items(): HasMany
|
|
{
|
|
return $this->hasMany(DocumentTemplateSectionItem::class, 'section_id')
|
|
->orderBy('sort_order');
|
|
}
|
|
}
|