57 lines
1.2 KiB
PHP
57 lines
1.2 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Models\ItemMaster;
|
||
|
|
|
||
|
|
use App\Traits\BelongsToTenant;
|
||
|
|
use App\Traits\ModelTrait;
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||
|
|
|
||
|
|
class ItemField extends Model
|
||
|
|
{
|
||
|
|
use BelongsToTenant, ModelTrait, SoftDeletes;
|
||
|
|
|
||
|
|
protected $fillable = [
|
||
|
|
'tenant_id',
|
||
|
|
'section_id',
|
||
|
|
'field_name',
|
||
|
|
'field_type',
|
||
|
|
'order_no',
|
||
|
|
'is_required',
|
||
|
|
'default_value',
|
||
|
|
'placeholder',
|
||
|
|
'display_condition',
|
||
|
|
'validation_rules',
|
||
|
|
'options',
|
||
|
|
'properties',
|
||
|
|
'created_by',
|
||
|
|
'updated_by',
|
||
|
|
'deleted_by',
|
||
|
|
];
|
||
|
|
|
||
|
|
protected $casts = [
|
||
|
|
'order_no' => 'integer',
|
||
|
|
'is_required' => 'boolean',
|
||
|
|
'display_condition' => 'array',
|
||
|
|
'validation_rules' => 'array',
|
||
|
|
'options' => 'array',
|
||
|
|
'properties' => 'array',
|
||
|
|
'created_at' => 'datetime',
|
||
|
|
'updated_at' => 'datetime',
|
||
|
|
'deleted_at' => 'datetime',
|
||
|
|
];
|
||
|
|
|
||
|
|
protected $hidden = [
|
||
|
|
'deleted_by',
|
||
|
|
'deleted_at',
|
||
|
|
];
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 소속 섹션
|
||
|
|
*/
|
||
|
|
public function section()
|
||
|
|
{
|
||
|
|
return $this->belongsTo(ItemSection::class, 'section_id');
|
||
|
|
}
|
||
|
|
}
|