This is my data retrieving query:
$admin_students=DB::select("select students.*,application_record.*,gender_record.*,
application_record.id as app_primary_id,application_record.status as app_status from students
left join application_record on application_record.student_id=students.id
left join application_record on application_record.gender_record_id=gender_record.name");
Table structure
Table 1 = application_record - > id, name, status, gender_record_id, ....
Table 2 = gender_record - > id, name
Now how can I return the Gender Name using the Gender Record ID which is the primary key for "Table 2"?