Commit ffbec5f1 authored by Maik Messerschmidt's avatar Maik Messerschmidt
Browse files

Added inputs.destroyAll.

parent a79e0315
......@@ -203,4 +203,9 @@ class InputController extends Controller
$input->delete();
return back();
}
public function destroyAll() {
Input::all()->each(function ($input) { $input->delete(); });
return back();
}
}
......@@ -55,6 +55,20 @@
</div>
<a href="{{ route('inputs.create') }}">Create a new entry</a> |
<a href="{{ route('inputs.import-form') }}">Import multiple entries from file
<a href="{{ route('inputs.import-form') }}">Import multiple entries from file |
<a href="_blank" class="text-danger confirm-delete" title="Remove ALL inputs"
data-form-id="remove-form-all"
data-message="Do you really want to delete ALL inputs?">
Delete <strong>ALL</strong> inputs
</a>
{{ Form::open([
'url' => route('inputs.destroyAll'),
'method' => 'delete',
'style' => 'display: none',
'id' => "remove-form-all"
]) }}
{{ Form::submit('send') }}
{{ Form::close() }}
@endsection
......@@ -22,6 +22,8 @@ Route::middleware(['web', 'auth'])->group(function() {
->name('experiments.reset');
Route::resource('/admin/experiments', 'ExperimentController');
Route::delete('/admin/inputs/delete-all', 'InputController@destroyAll')
->name('inputs.destroyAll');
Route::get('/admin/inputs/import', 'InputController@importForm')
->name('inputs.import-form');
Route::post('/admin/inputs/import', 'InputController@import')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment