Update AdminController

This commit is contained in:
Daniel Supernault 2019-02-10 18:00:05 -07:00
parent 67983516ea
commit 549ce89b4b
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -43,7 +43,7 @@ class AdminController extends Controller
public function home() public function home()
{ {
$data = Cache::remember('admin:dashboard:home:data', 1, function() { $data = Cache::remember('admin:dashboard:home:data', 15, function() {
return [ return [
'failedjobs' => [ 'failedjobs' => [
'count' => PrettyNumber::convert(FailedJob::where('failed_at', '>=', \Carbon\Carbon::now()->subDay())->count()), 'count' => PrettyNumber::convert(FailedJob::where('failed_at', '>=', \Carbon\Carbon::now()->subDay())->count()),
@ -100,6 +100,7 @@ class AdminController extends Controller
$dir = $request->query('dir') ?? 'desc'; $dir = $request->query('dir') ?? 'desc';
$stats = $this->collectUserStats($request); $stats = $this->collectUserStats($request);
$users = User::withCount('statuses')->orderBy($col, $dir)->paginate(10); $users = User::withCount('statuses')->orderBy($col, $dir)->paginate(10);
return view('admin.users.home', compact('users', 'stats')); return view('admin.users.home', compact('users', 'stats'));
} }