From 672f475a0d93462a43c82ba3ae16c064b0939f5d Mon Sep 17 00:00:00 2001 From: James Brooks Date: Fri, 29 May 2015 21:56:06 +0100 Subject: [PATCH] Fix handling of settings not existing --- app/Config/Repository.php | 2 +- app/Http/Controllers/HomeController.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Config/Repository.php b/app/Config/Repository.php index 98eb467b..d346223f 100644 --- a/app/Config/Repository.php +++ b/app/Config/Repository.php @@ -56,7 +56,7 @@ class Repository } // if the setting exists, return it - if (isset($this->settings[$name])) { + if (isset($this->settings[$name]) && $this->settings[$name]) { return $this->settings[$name]; } diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 26ea429e..b38de0e8 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -85,7 +85,7 @@ class HomeController extends AbstractController // Sort the array so it takes into account the added days $allIncidents = $allIncidents->sortBy(function ($value, $key) { return strtotime($key); - }, SORT_REGULAR, true); + }, SORT_REGULAR, true)->all(); // Scheduled maintenance code. $scheduledMaintenance = Incident::scheduled()->orderBy('scheduled_at')->get();