<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class AssociationProfileFieldSetting extends Model
{
    use HasFactory;

    protected $fillable = [
        'association_id',
        'profile_field_id',
        'is_enabled',
        'is_required',
        'visibility',
        'order',
    ];

    protected $casts = [
        'is_enabled' => 'boolean',
        'is_required' => 'boolean',
    ];

    public function association()
    {
        return $this->belongsTo(Association::class);
    }

    public function field()
    {
        return $this->belongsTo(ProfileField::class, 'profile_field_id');
    }
}
