1
0
Fork 0
forked from mirror/pixelfed

Update SiteController

This commit is contained in:
Daniel Supernault 2019-06-19 19:49:17 -06:00
parent 79524a0578
commit 13ceef0f9e
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -42,14 +42,19 @@ class SiteController extends Controller
public function about()
{
$stats = Cache::remember('site:about', now()->addMinutes(120), function() {
return [
return Cache::remember('site:about', now()->addMinutes(120), function() {
$page = Page::whereSlug('/site/about')->whereActive(true)->first();
$stats = [
'posts' => Status::whereLocal(true)->count(),
'users' => User::count(),
'admin' => User::whereIsAdmin(true)->first()
];
if($page) {
return View::make('site.about-custom')->with(compact('page', 'stats'))->render();
} else {
return View::make('site.about')->with(compact('stats'))->render();
}
});
return view('site.about', compact('stats'));
}
public function language()