Hello,
I'm a beginner in Laravel, can you help me please ?
I create app from older app and I recovers existing tables.
I have 2 table (Member and Student), a student can be only a member and vice versa .
In members I have the student_id.
I have already a relation in member (belongsTo Student) for another needs.
My problem, is I want to get a value (bam_id who is in Member table) from a student model.
So I make a relation in Student model (belongsTo Member)
And I try $students->member()->bam_adherent but I get this error message :
"Trying to get property 'bam_adherent' of non-object"
$students is a Student model
I don't understant how I can get the value
Do you have an idea of my error ?