<?php
namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Member extends Model
{
    protected $fillable = [
        'name',
        'dob',
        'district',
        'mobile',
        'gender',
        'constituency',
    ];

    protected $casts = [
        'dob' => 'date',
    ];

    // No updated_at in your table
    const UPDATED_AT = null;

    // Age accessor
    public function getAgeAttribute(): int
    {
        return $this->dob->age;
    }
}
