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

Added destroyAll route to ResultController.

parent b83883e8
......@@ -221,6 +221,11 @@ class ResultController extends Controller
return back();
}
public function destroyAll() {
Result::all()->each(function ($result) { $result->delete(); });
return back();
}
/**
* API route for submitting results for the experiment.
*/
......
......@@ -58,6 +58,20 @@
</table>
<a href="{{ route('results.show-all-csv') }}">Download all results as CSV</a> |
<a href="{{ route('results.download-zip') }}">Download all results as Zip</a>
<a href="{{ route('results.download-zip') }}">Download all results as Zip</a> |
<a href="_blank" class="text-danger confirm-delete" title="Remove ALL results"
data-form-id="remove-form-all"
data-message="Do you really want to delete ALL results?">
Delete <strong>ALL</strong> results
</a>
{{ Form::open([
'url' => route('results.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/results/delete-all', 'ResultController@destroyAll')
->name('results.destroyAll');
Route::get('/admin/results/show-json/{result}', 'ResultController@showJson')
->name('results.show-json');
Route::get('/admin/results/show-all-csv', 'ResultController@showAllCSV')
......
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