I want to get the next participant if i press next button sort by category and sort by gymnast tag
here my code to get first users
$selectparticipant = Magmodel::where('IDEVENT', '=', $id)
->where('SESSION', '=', $selectsession)
->where('GROUP', '=', $selectgroup)
->orderBy('Category', 'ASC')
->orderBy('TAG', 'ASC')->first();
i want it get second record if i press next
here my code to get next participant
$selectparticipant = Magmodel::where('IDEVENT', '=', $ied)
->where('SESSION', '=', $selectsession)
->where('GROUP', '=', $selectgroup)
->where('gymnastmag.TAG', '>', $ps->TAG)
->orderBy('Category', 'ASC')
->orderBy('TAG', 'ASC')->first();
but it will not show the next record if it has different Category but smaller tag
here my database
i want it show Bon first when i press next show Johny, when press next again show Ryan, when press next again Show Lucas, when press next again show Abraham, when press next again show Lucky, when press next again show Bernard,
can someone please help me with next and prev function