Update Cache, prepare for laravel 5.8

This commit is contained in:
Daniel Supernault 2019-02-25 11:56:24 -07:00
parent 6bbef6ac4e
commit 4739c25fe0
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
15 changed files with 31 additions and 30 deletions

View file

@ -41,10 +41,10 @@ class SiteController extends Controller
public function about()
{
$res = Cache::remember('site:about', 120, function() {
$res = Cache::remember('site:about', now()->addMinutes(120), function() {
$custom = Page::whereSlug('/site/about')->whereActive(true)->exists();
if($custom) {
$stats = Cache::remember('site:about:stats', 60, function() {
$stats = Cache::remember('site:about:stats', now()->addMinutes(60), function() {
return [
'posts' => Status::whereLocal(true)->count(),
'users' => User::count(),
@ -53,7 +53,7 @@ class SiteController extends Controller
});
return View::make('site.about')->with('stats', $stats)->render();
} else {
$stats = Cache::remember('site:about:stats', 60, function() {
$stats = Cache::remember('site:about:stats', now()->addMinutes(60), function() {
return [
'posts' => Status::whereLocal(true)->count(),
'users' => User::count(),