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
}
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 }
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?
you can send it as an array using html []
<input type="checkbox" name="checkboxes[]" value="{{ $object->id }}">
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community