39 lines
886 B
PHP
39 lines
886 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Models\Documents;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 문서 양식 기본필드 모델
|
||
|
|
*
|
||
|
|
* @property int $id
|
||
|
|
* @property int $template_id
|
||
|
|
* @property string $label 필드 라벨
|
||
|
|
* @property string $field_type 필드 타입 (text/date/select 등)
|
||
|
|
* @property string|null $default_value 기본값
|
||
|
|
* @property int $sort_order 정렬 순서
|
||
|
|
*/
|
||
|
|
class DocumentTemplateBasicField extends Model
|
||
|
|
{
|
||
|
|
protected $table = 'document_template_basic_fields';
|
||
|
|
|
||
|
|
protected $fillable = [
|
||
|
|
'template_id',
|
||
|
|
'label',
|
||
|
|
'field_type',
|
||
|
|
'default_value',
|
||
|
|
'sort_order',
|
||
|
|
];
|
||
|
|
|
||
|
|
protected $casts = [
|
||
|
|
'sort_order' => 'integer',
|
||
|
|
];
|
||
|
|
|
||
|
|
public function template(): BelongsTo
|
||
|
|
{
|
||
|
|
return $this->belongsTo(DocumentTemplate::class, 'template_id');
|
||
|
|
}
|
||
|
|
}
|