<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Inspecteur extends Model
{
    //
    use HasFactory;
   // nomfr nomar matricule nni date_naissance lieu_naissance_ar lieu_naissance_fr date_affectation
   // contact date_mise_en_corps_IES Bank compte email matrimonialite date_recri_fp photo discipline_id pole_id
    protected $fillable = ['nomfr', 'nomar','matricule','nni','date_naissance','lieu_naissance_ar','lieu_naissance_fr', 'date_affectation','contact','date_mise_en_corps_IES','bank', 'compte','email','matrimonialite','date_recri_fp','photo','discipline_id','pole_id','langue'];

    public function discipline(): BelongsTo
    {
        return $this->belongsTo(Discipline::class);
    }
    public function pole(): BelongsTo
    {
        return $this->belongsTo(Pole::class);
    }
    public function user(): HasOne
    {
        return $this->hasOne(User::class);
    }
    public function rapports(): HasMany
    {
        return $this->hasMany(Rapport::class);
    }
  
}
