Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

vicruz's avatar

how to insert an array with radio button per row

I want to insert a different status for each student per row where my status are (present, absent,late,others)

Here's my view

List of Students Enrolled Student ID Student Name Present Late Absent Others Comments
    </tr>
</thead>

<tbody>
    @foreach ($users as $users)
        <tr>
  <td>{{ $users->student_id  }} </td>
   <td>{{ $users->student_firstname  }} {{ $users->student_lastname  }}</td> 
   <td>{{ Form::radio('student['.$users->student_id.'][status]', 'present' , true) }}</td>
<td>{{ Form::radio('student['.$users->student_id.'][status]', 'late' ) }}</td>
<td>{{ Form::radio('student['.$users->student_id.'][status]', 'absent') }}</td>
<td>{{ Form::radio('student['.$users->student_id.'][status]', 'others') }}</td>
<td>{{ Form::text('student['.$users->student_id.'][comment]') }}</td>

      @endforeach

Is there anyway i can insert this inside a function in my controller?

0 likes
0 replies

Please or to participate in this conversation.