Is it possible , in one to one relationship more then one field(colums) between two table. What is its solution ?
For example , I have student result table and books table.
Student result table relate to books table with two fields:
one course,
second gender.
How make relationship between them ? similarly I have other tables
student result gazett model relationship to the table CourseSubjectAllocation which has related books names according to their courses
/**
* Relationship with coursesubjectallocation one to one with colums CourseID of table coursesubjectallocation
*/
public function coursesubjectallocation()
{
return $this->hasOne('App\CourseSubjectAllocation','CourseID', 'Courseid');
}
here is gender field into the CourseSubjectAllocation table
and books names into the
/**
* Relationship with Gazett one to one with colums Courseid of table Gazett_*_*_*
*/
public function gazett()
{
return $this->belongsTo('App\Gazett','Courseid', 'CourseID');
}
here is gender field into the gazett table
I also want to relationship with another gender field into these models.