<?php

namespace App\Models;

use App\Models\BaseModel;

class FamilyCommPref extends BaseModel
{
    protected $table = 'family_comm_prefs';

    // CI model didn't specify timestamps
    public $timestamps = true;

    protected $fillable = [
        'family_id',
        'category',
        'via_email',
        'via_sms',
        'cc_all_guardians',
        'created_at',
        'updated_at',
    ];

    protected $casts = [
        'family_id'         => 'integer',
        'via_email'         => 'boolean',
        'via_sms'           => 'boolean',
        'cc_all_guardians'  => 'boolean',
    ];

    // Optional relationship
    public function family()
    {
        return $this->belongsTo(Family::class, 'family_id');
    }
}