public getWithClassrooms ( integer $student_id ) : Illuminate\Database\Eloquent\Collection | ||
$student_id | integer | |
return | Illuminate\Database\Eloquent\Collection |
public function getWithClassrooms($student_id)
{
$model = $this->model;
$student = $model->with('classrooms')->find($student_id);
return $student->classrooms;
}