Commit 22d07a7e authored by Maik Messerschmidt's avatar Maik Messerschmidt
Browse files

Don't send result data to index view.

parent 720e735a
......@@ -16,21 +16,38 @@ use Zip;
class ResultController extends Controller
{
/**
* Fields provided to the index view.
*
* Needed to avoid including the 'data' field, which can get very large.
*/
private rowsForIndex = [
"id",
"experiment",
"created_at",
"ip",
"session_id",
];
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index() {
return view('results.index', [
'results' => Result::where('partial', false)->get(),
]);
$results = Result::select($this->rowsForIndex)
->where('partial', false)
->get();
return view('results.index', ['results' => $results]);
}
public function indexPartial() {
return view('results.index', [
'results' => Result::where('partial', true)->get(),
]);
$results = Result::select($this->rowsForIndex)
->where('partial', true)
->get();
return view('results.index', ['results' => $results]);
}
/**
......
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