Skip to content

Commit

Permalink
Order events by time in schedule controller so that convertToTable wo…
Browse files Browse the repository at this point in the history
…rks right
  • Loading branch information
tdiam committed Feb 18, 2018
1 parent ba09884 commit 88a8177
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/Http/Controllers/ScheduleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ private function convertToTable($s) {

public function index(Request $request) {
$mdl=new Schedule();
$talks=$mdl::where('type','=','talk')->get()->toArray();
$performances=$mdl::where('type','=','performance')->get()->toArray();
$workshops=$mdl::where('type','=','workshop')->get()->toArray();
$talks=$mdl::where('type','=','talk')->orderBy('hour', 'asc')->get()->toArray();
$performances=$mdl::where('type','=','performance')->orderBy('hour', 'asc')->get()->toArray();
$workshops=$mdl::where('type','=','workshop')->orderBy('hour', 'asc')->get()->toArray();
$schedule=compact('talks', 'performances', 'workshops');

$rows = $this->convertToTable($schedule);
Expand Down

0 comments on commit 88a8177

Please sign in to comment.