I deduce answers to questions using pagination (1 question per page). I want the old input of the checkbox to remain when switching from page to page. I looked at all the questions on the stack on this topic, but nothing helped.
@foreach ($quest->answer as $answer) <div class="custom-control custom-checkbox ml-5 my-1"> <input type="checkbox" name="checkbox[{{ $answer->id }}]" value="{{ $answer->id }}" @if (is_array(old('checkbox')) && in_array($answer->id, array_keys(old('checkbox')))) checked @endif> <label class="custom-control-label h6-responsive" for="checkbox-answer{{ $answer->id }}">{{ $answer->answer }}</label> </div> @endforeach {{ $questions->links() }} 
<input type="submit" name="question" value="ТУТ НОМЕР ВОПРОСА">- Rustam Gimranov