|
|
@ -30,6 +30,8 @@ class DashController extends Controller |
|
|
|
// 'most-liked' => 'Most Liked', |
|
|
|
// 'most-liked' => 'Most Liked', |
|
|
|
'newest' => 'Newest', |
|
|
|
'newest' => 'Newest', |
|
|
|
'oldest' => 'Oldest', |
|
|
|
'oldest' => 'Oldest', |
|
|
|
|
|
|
|
'most-rows' => 'Longest', |
|
|
|
|
|
|
|
'least-rows' => 'Shortest', |
|
|
|
]; |
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
$data['users'] = User::orderBy('updated_at', 'desc') |
|
|
|
$data['users'] = User::orderBy('updated_at', 'desc') |
|
|
@ -54,6 +56,16 @@ class DashController extends Controller |
|
|
|
case 'most-liked': |
|
|
|
case 'most-liked': |
|
|
|
$tableQuery = $tableQuery->orderBy('favourites_count', 'desc'); |
|
|
|
$tableQuery = $tableQuery->orderBy('favourites_count', 'desc'); |
|
|
|
break; |
|
|
|
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': |
|
|
|
case 'newest': |
|
|
|
$tableQuery = $tableQuery->orderBy('created_at', 'desc'); |
|
|
|
$tableQuery = $tableQuery->orderBy('created_at', 'desc'); |
|
|
|
break; |
|
|
|
break; |
|
|
|