Questions & Answers

How to select different registers in a table in a laravel view?

Here´s the thing. I have a view to show different students in a table. I`d like to select some of them, and send that to a method in my controller. Here is my table in the view:

<body style="background-color:#DEF5E5;">
       <h1>Añade amigos de {{$student->name}}</h1>
       <table class="table">
         <thead style="background-color:#9ED5C5">
             @foreach($students as $student)

     <div class="container">
       <h1>Debes iniciar sesión</h1>


I'd like to select some of the registers, store them in and array or something like that and send that array to a method in my controller, but I don`t know how to select various rows and send them. Thank you.

2023-01-20 23:30:10
One way would be to use a form around your table and checkboxes (with the row's student's ID as value f.e.) in each table row to select a register, then submit the form
Answers(0) :