- 마이그레이션 9개 생성 (unit_options, section_templates, item_master_fields, item_pages, item_sections, item_fields, item_bom_items, custom_tabs, tab_columns) - Eloquent 모델 9개 구현 (ItemMaster 네임스페이스) - ItemMasterSeeder 작성 및 테스트 데이터 생성 주요 특징: - Multi-tenant 지원 (BelongsToTenant trait) - Soft Delete 적용 (deleted_at, deleted_by) - 감사 로그 지원 (created_by, updated_by) - JSON 필드로 동적 속성 지원 (display_condition, validation_rules, options, properties) - FK 제약조건 및 Composite Index 설정 - 계층 구조 (ItemPage → ItemSection → ItemField/ItemBomItem) SAM API Development Rules 준수
35 lines
619 B
PHP
35 lines
619 B
PHP
<?php
|
|
|
|
namespace App\Models\ItemMaster;
|
|
|
|
use App\Traits\BelongsToTenant;
|
|
use App\Traits\ModelTrait;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class TabColumn extends Model
|
|
{
|
|
use BelongsToTenant, ModelTrait;
|
|
|
|
protected $fillable = [
|
|
'tenant_id',
|
|
'tab_id',
|
|
'columns',
|
|
'created_by',
|
|
'updated_by',
|
|
];
|
|
|
|
protected $casts = [
|
|
'columns' => 'array',
|
|
'created_at' => 'datetime',
|
|
'updated_at' => 'datetime',
|
|
];
|
|
|
|
/**
|
|
* 소속 탭
|
|
*/
|
|
public function tab()
|
|
{
|
|
return $this->belongsTo(CustomTab::class, 'tab_id');
|
|
}
|
|
}
|