Skip to content

Instantly share code, notes, and snippets.

@nobodyplace
Last active July 29, 2019 03:56
Show Gist options
  • Select an option

  • Save nobodyplace/6fc610d23cc6e63919e78668d7342110 to your computer and use it in GitHub Desktop.

Select an option

Save nobodyplace/6fc610d23cc6e63919e78668d7342110 to your computer and use it in GitHub Desktop.
<?php
$posts = array();
array_push($posts,(object) [
'title' => $entry->title
,'author' => $entry->author
,'permalink' => $entry->url
,'created' => new Carbon('2019-07-29 12:24:51')
,'description' => $entry->description
,'content' => $entry->content
]);
$feed = App::make('feed');
$feed->setDateFormat('carbon');
$feed->pubdate = $posts[0]->created;
foreach ($posts as $post) {
$feed->add(
$post->title
,$post->author
,$post->permalink
,$post->created // 2019-04-24 11:23:24 と出力される
,$post->description
,$post->content
);
}
return $feed->render('rss');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment