<?php

namespace App\Modules\Customization\CustomFields\Models;

use App\Modules\Admin\Tenancy\Traits\BelongsToTenant;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class CustomFieldValue extends Model
{
    use BelongsToTenant;

    protected $fillable = [
        'custom_field_id',
        'entity_type',
        'entity_id',
        'value',
        'tenant_id',
    ];

    public function field(): BelongsTo
    {
        return $this->belongsTo(CustomField::class, 'custom_field_id');
    }
}
