Last active
July 29, 2019 03:56
-
-
Save nobodyplace/6fc610d23cc6e63919e78668d7342110 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 | |
| ,$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