我想使用National来搜索最后的道歉,其中来自学生功能的National_id等于我该怎么做?
我尝试过:
return [
'Students' => function ($students){
$students->select('id', 'username','national_id', 'is_foreigner', 'college_id')
->with([
'Apologies' => function ($apologies) use ($students) {
$apologies->select('student_id', 'reasons');
->where('national', 'students.national_id');
}
]);
}
]