<?php

namespace App\Models;

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

class Member extends Model
{
    use HasFactory;

    protected $fillable = [
        'user_id',
        'member_name',
        'father_name',
        'mother_name',
        'present_address',
        'permanent_address',
        'profession',
        'birth_of_date',
        'nationality',
        'professional_address',
        'member_phone',
        'nid_no',
        'member_photo',
        'nomini_name',
        'nomini_father_name',
        'nomini_mother_name',
        'nomini_present_address',
        'nomini_permanent_address',
        'nomini_profession',
        'nomini_birth_of_date',
        'nomini_nationality',
        'nomini_professional_address',
        'nomini_phone',
        'relation',
        'nomini_nid_no',
        'nomini_photo',
        'status',
    ];

    public function userData()
    {
        return $this->belongsTo(User::class,'user_id');
    }

    protected function serializeDate(DateTimeInterface $date)
    {
        return $date->format('d-m-Y H:i:s');
    }
}
