Level 24
Use lazy loading for the student_certificates relationship:
$certificate = Certificate::find($id);
$student_certificates = $certificate->student_certificates()
->with('user', 'student_certificate_courses.course')->paginate();
I am retrieving some data using eager loading, But now i need to add pagination on that. My query is:
$certificateData = Certificate::with(['student_certificates', 'student_certificates.user', 'student_certificates.student_certificate_courses', 'student_certificates.student_certificate_courses.course']) ->where('id', $id) ->first();
Now i need to pagination student_certificates. Can anyone help me with that.
Please or to participate in this conversation.