Menyimpan data dari foreach radio button laravel di controller

(tabel terdiri dari survei dan detail_survei)

survei : id, nama, telepon

detail_survei: id, id_survei, rating, id_pertanyaan

di view

 @foreach ($pertanyaan as $p)
            <div class="form-group row">
                <label class="col-sm-2 col-form-label">{{++$i}}. {{$p->pertanyaan}}</label><br>
                <input type="text" name="id_pertanyaan" value="{{$p->id}}">
                <input type="text" name="id_survei" value="{{$survey->id}}">
                <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="rating{{$p->id}}" value="1">
                    <input class="form-check-input" type="radio" name="rating{{$p->id}}" value="2">
                    <input class="form-check-input" type="radio" name="rating{{$p->id}}" value="3">
                    <input class="form-check-input" type="radio" name="rating{{$p->id}}" value="4">
                    <input class="form-check-input" type="radio" name="rating{{$p->id}}" value="5">
                </div>
            </div>
            @endforeach

avatar muhammadnurauliady_google
@muhammadnurauliady_google

1 Kontribusi 0 Poin

Dipost 4 tahun yang lalu

Belum ada Jawaban. Jadi yang pertama Jawaban

Login untuk ikut Jawaban