Validate checkbox array and prefill with selected value on validation error in laravel 5
Say for example you have your checkbox field code in your twig file as below:- @foreach ($serviceList as $servloop) <div class=”checkbox”> <label> <input type=”checkbox” name=”services[]” value=”{{$servloop->service_id}}” {{ ( is_array(old(‘services’)) && in_array($servloop->service_id, old(‘services’)) ) ? ‘checked ‘
Read article
