How can get relation Beetwen 3 tables
enfants [id,nom,prenom]
responsables[id,nom,prenom]
relations[id,libelle] // père, mère, frère ...
responsable_enfants[id,enfant_id,responsable_id,relation_id]
Model Enfant.php
public function responsables(){
return $this->belongsToMany(Responsable::class, 'responsable_enfants', 'enfant_id', 'responsable_id');
}
So can i get relation betwen enfants and responsable (père or mère ...)?