- fire-shutter 가이드레일/셔터박스/3D 렌더링 - sales 가격시뮬레이터/프로모션 할인 - bim 뷰어/생성기, pmis 작업일보/출면일보 - demo-tenant 체험 관리 - 전표/급여/전자서명 버그 수정
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');
|
|
}
|
|
}
|