Last active
July 29, 2019 03:56
-
-
Save nobodyplace/6e410e158a362ed9a1dc249c5314740e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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 | |
| ,$feed->formatDate($post->created,$feed->getDateFormat()) // Mon, 29 Jul 2019 12:24:51 +0900 と出力される | |
| ,$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