Update about page with stats and instance admin

This commit is contained in:
Daniel Supernault 2018-12-04 13:46:07 -07:00
parent 1518cce4fc
commit 794cf80c15
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
2 changed files with 37 additions and 2 deletions

View file

@ -68,7 +68,14 @@ class SiteController extends Controller
public function about()
{
return view('site.about');
$stats = Cache::remember('site:about:stats', 1440, function() {
return [
'posts' => Status::whereLocal(true)->count(),
'users' => User::count(),
'admin' => User::whereIsAdmin(true)->first()
];
});
return view('site.about', compact('stats'));
}
public function language()