<?php

namespace App\Models\ItemMaster;

use App\Traits\Auditable;
use App\Traits\BelongsToTenant;
use App\Traits\ModelTrait;
use Illuminate\Database\Eloquent\Model;

class TabColumn extends Model
{
    use Auditable, 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');
    }
}
