mercredi 13 mars 2019

Laravel paginate not working in certain query but works in other query

As I am now putting a lot of data in my database I needed to use laravel's paginate. However, it doesn't seem to work in my other query. Is there other way? or what did I do wrong?

My code is shown below

Paginate Working (ExamController)

$exams = Exam::with('users')->where('id',$userID)->paginate(5);

Paginate Not Working (Questions Controller)

$all = Exam::with(['questions', 'questions.choices'])->where('exam_id', $examID)->paginate(5);

Code to display pagination

   ---- exams view
   ---- questions view



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire