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
1 changed files with 8 additions and 3 deletions

View File

@ -42,14 +42,19 @@ class SiteController extends Controller
public function about() public function about()
{ {
$stats = Cache::remember('site:about', now()->addMinutes(120), function() { return Cache::remember('site:about', now()->addMinutes(120), function() {
return [ $page = Page::whereSlug('/site/about')->whereActive(true)->first();
$stats = [
'posts' => Status::whereLocal(true)->count(), 'posts' => Status::whereLocal(true)->count(),
'users' => User::count(), 'users' => User::count(),
'admin' => User::whereIsAdmin(true)->first() '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() public function language()