From 9f8ae4d952be6246724cf79ecc996b76fe67c515 Mon Sep 17 00:00:00 2001 From: Samuel De Backer Date: Sun, 7 Feb 2016 16:50:16 +0100 Subject: [PATCH] feed when empty --- src/Http/Controllers/PublicController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Http/Controllers/PublicController.php b/src/Http/Controllers/PublicController.php index d58471f..42b9681 100644 --- a/src/Http/Controllers/PublicController.php +++ b/src/Http/Controllers/PublicController.php @@ -58,7 +58,7 @@ public function feed() } $feed->link = url()->route(config('app.locale').'.news.feed'); $feed->setDateFormat('datetime'); // 'datetime', 'timestamp' or 'carbon' - $feed->pubdate = $models[0]->created_at; + $feed->pubdate = isset($models[0]) and $models[0]->created_at; $feed->lang = config('app.locale'); $feed->setShortening(true); // true or false $feed->setTextLimit(100); // maximum length of description text