public static function getSeancesPasseesDuProf($id) { $seances = DB::table('horaires')->join('matieres', 'matieres.id', '=', 'horaires.matiere_id')->join('enseignants', 'enseignants.id', '=', 'matieres.enseignant_id')->where('enseignants.id', '=', $id)->select('horaires.id as id', 'horaires.date as date', 'horaires.h_debut as h_debut', 'horaires.h_fin as h_fin', 'horaires.matiere_id as matiere_id', 'horaires.created_at as created_at', 'horaires.updated_at as updated_at')->get(); $seances = Horaire::hydrate($seances); return $seances; }