<?php

namespace App\Models;

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

class Personne extends Model
{
    /** @use HasFactory<\Database\Factories\PersonneFactory> */
    use HasFactory;
    protected $fillable = [
        'nom',
        'postnom',
        'prenom',
        'sexe',
        'age',
        'lieu_naissance',
        'date_naissance',
        'adresse_id',
        'telephone',
        'etat_civil_id',
        'chapelle_id',
        'service_id',
        'status',
        'isBaptized',
        'isMarried',
        'isDivorce',
        'isHandicap',
        'isWidow',
        'isDead',
        'isAbandon',
        'isRetrograde',
    ];

    public function adresse()
    {
        return $this->belongsTo(Adresse::class);
    }
    // public function commission()
    // {
    //     return $this->belongsTo(Commission::class);
    // }
    public function etatCivil()
    {
        return $this->belongsTo(Etat_civil::class);
    }

    public function chapelle()
    {
        return $this->belongsTo(Chapelle::class);
    }
    public function service()
    {
        return $this->belongsTo(Service::class);
    }

    public function personne()
    {
        return $this->hasMany(Personne::class);
    }
}