Support the ongoing development of Laravel.io →
Requests Input Forms
Last updated 3 months ago.
0

You will want to make sure those checkboxes are an array eg <input type="checkbox" name="id[]"> and then when you send it to your controller you can use the Request object to see them.

public function store(Request $request)
{
  dd($request->all());

  // would technically access them via $request->input('id'); // would return the array
}

~ https://laracademy.co/

0

laracademy said:

You will want to make sure those checkboxes are an array eg <input type="checkbox" name="id[]"> and then when you send it to your controller you can use the Request object to see them.

public function store(Request $request)
{
 dd($request->all());

 // would technically access them via $request->input('id'); // would return the array
}

~ https://laracademy.co/

Do i need to wrap the table with all it is rows? Or i can collect all selected checkboxes with it is ID's values and somehow to send them like object, or json_encode array or what, i do not know how it works here?

Because as i understand i have to wrap the table, or when clicked on checkbox, create in hidden form input name="id[ value of checkbox ]" and make onclick event for a href="delete_id". Do i? Or there is in laravel better ways to do that?

Last updated 5 years ago.
0

you can send it as an array using html []

<input type="checkbox" name="checkboxes[]" value="{{ $object->id }}">
Last updated 5 years ago.
0

Sign in to participate in this thread!

LoadForge

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.