Hi guys can you please help me to find this flaw in my code.
I have two foreign keys in the course table which are: matiere_id and id_eleve. The insert works for the course table but I want to display only the courses that concern each teacher
as a teacher. I don't see the courses I added but those of another teacher.
$yere = Auth::user();
$teacher = Teacher::where('user_id', $yere->id)->first(); //id of the teacher who made the request
$subjects = Subject::where('teacher_id', $teacher->id)->get();
$course = Course::where('subject_id', $master->id)->get();