I'm new to deleting multiple checkboxes so i need a little help. I've been searching the web for like hours but i can't fix my problem.
I have a todo list and there are some todo's showing from the database on my webpage.How can i delete all selected checkboxes in one click?
I'm using Laravel 5.4
ToDoController:
public function destroy()
{
$checked = Request::input('checked')['checked'];
$checked->delete();
}
Blade:
@foreach ($todo as $todoresult)
<form method="get" action="/todo/destroy/">
<div class="checkbox">
<label><input type="checkbox" value="{{$todoresult->id}}" name="checked[]">{{$todoresult->todoinfo}}</label><br />
</div>
@endforeach
</div>
<div class="panel-footer">
<button class="btn btn-success" type="submit">Verwerken</button>
</form>
Route:
Route::get('/todo/destroy/', 'ToDoController@destroy');
How would i do this? And how would my routing be like?