From 8e151df1905858b65b0f22dadb803ee4f4dcf9bf Mon Sep 17 00:00:00 2001 From: Samuel De Backer Date: Tue, 29 Mar 2016 17:22:25 +0200 Subject: [PATCH] pubdate --- src/Http/Controllers/PublicController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Http/Controllers/PublicController.php b/src/Http/Controllers/PublicController.php index 42b9681..ffd0800 100644 --- a/src/Http/Controllers/PublicController.php +++ b/src/Http/Controllers/PublicController.php @@ -58,7 +58,9 @@ public function feed() } $feed->link = url()->route(config('app.locale').'.news.feed'); $feed->setDateFormat('datetime'); // 'datetime', 'timestamp' or 'carbon' - $feed->pubdate = isset($models[0]) and $models[0]->created_at; + if (isset($models[0]) && $models[0]->created_at) { + $feed->pubdate = $models[0]->created_at; + } $feed->lang = config('app.locale'); $feed->setShortening(true); // true or false $feed->setTextLimit(100); // maximum length of description text