Files
sam-manage/app/Models/DocumentTemplateBasicField.php

29 lines
591 B
PHP
Raw Normal View History

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class DocumentTemplateBasicField extends Model
{
use HasFactory;
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');
}
}