|
|
|
@ -30,6 +30,8 @@ class DashController extends Controller |
|
|
|
|
// 'most-liked' => 'Most Liked', |
|
|
|
|
'newest' => 'Newest', |
|
|
|
|
'oldest' => 'Oldest', |
|
|
|
|
'most-rows' => 'Longest', |
|
|
|
|
'least-rows' => 'Shortest', |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
$data['users'] = User::orderBy('updated_at', 'desc') |
|
|
|
@ -54,6 +56,16 @@ class DashController extends Controller |
|
|
|
|
case 'most-liked': |
|
|
|
|
$tableQuery = $tableQuery->orderBy('favourites_count', 'desc'); |
|
|
|
|
break; |
|
|
|
|
case 'most-rows': |
|
|
|
|
$tableQuery = $tableQuery |
|
|
|
|
->join('revisions', 'revisions.id', '=', 'tables.revision_id') |
|
|
|
|
->orderBy('revisions.row_count', 'desc'); |
|
|
|
|
break; |
|
|
|
|
case 'least-rows': |
|
|
|
|
$tableQuery = $tableQuery |
|
|
|
|
->join('revisions', 'revisions.id', '=', 'tables.revision_id') |
|
|
|
|
->orderBy('revisions.row_count', 'asc'); |
|
|
|
|
break; |
|
|
|
|
case 'newest': |
|
|
|
|
$tableQuery = $tableQuery->orderBy('created_at', 'desc'); |
|
|
|
|
break; |
|
|
|
|