|
|
@ -20,7 +20,9 @@ class DashController extends Controller |
|
|
|
return back(); |
|
|
|
return back(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$data['tableSort'] = $sort = \Input::get('tableSort', 'last-updated'); |
|
|
|
$defaultSort = 'last-updated'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$sort = \Input::get('tableSort', $defaultSort); |
|
|
|
|
|
|
|
|
|
|
|
$data['sortOptions'] = [ |
|
|
|
$data['sortOptions'] = [ |
|
|
|
'most-visited' => 'Most Visited', |
|
|
|
'most-visited' => 'Most Visited', |
|
|
@ -34,6 +36,12 @@ class DashController extends Controller |
|
|
|
'least-rows' => 'Shortest', |
|
|
|
'least-rows' => 'Shortest', |
|
|
|
]; |
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!in_array($sort, array_keys($data['sortOptions']))) { |
|
|
|
|
|
|
|
$sort = $defaultSort; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$data['tableSort'] = $sort; |
|
|
|
|
|
|
|
|
|
|
|
$data['users'] = User::orderBy('updated_at', 'desc') |
|
|
|
$data['users'] = User::orderBy('updated_at', 'desc') |
|
|
|
->withCount(['tables']) |
|
|
|
->withCount(['tables']) |
|
|
|
->paginate(10, ['id', 'title', 'name', 'tables_count'], 'userPage') |
|
|
|
->paginate(10, ['id', 'title', 'name', 'tables_count'], 'userPage') |
|
|
|