Skip to content

Commit

Permalink
feed date
Browse files Browse the repository at this point in the history
  • Loading branch information
sdebacker committed Mar 29, 2016
1 parent 8e151df commit 9e00dda
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Http/Controllers/PublicController.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ public function feed()
}
$feed->link = url()->route(config('app.locale').'.news.feed');
$feed->setDateFormat('datetime'); // 'datetime', 'timestamp' or 'carbon'
if (isset($models[0]) && $models[0]->created_at) {
$feed->pubdate = $models[0]->created_at;
if (isset($models[0]) && $models[0]->date) {
$feed->pubdate = $models[0]->date;
}
$feed->lang = config('app.locale');
$feed->setShortening(true); // true or false
$feed->setTextLimit(100); // maximum length of description text

foreach ($models as $model) {
$feed->add($model->title, null, url($model->uri()), $model->created_at, $model->summary, $model->body);
$feed->add($model->title, null, url($model->uri()), $model->date, $model->summary, $model->body);
}
}

Expand Down

0 comments on commit 9e00dda

Please sign in to comment.