| Package Data | |
|---|---|
| Maintainer Username: | thujohn |
| Maintainer Contact: | jonathan.thuau@gmail.com (thujohn) |
| Package Create Date: | 2013-07-04 |
| Package Last Update: | 2016-03-31 |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-10-26 03:14:09 |
| Package Statistics | |
|---|---|
| Total Downloads: | 129,564 |
| Monthly Downloads: | 55 |
| Daily Downloads: | 5 |
| Total Stars: | 70 |
| Total Watchers: | 6 |
| Total Forks: | 17 |
| Total Open Issues: | 11 |
RSS builder for Laravel 4
Add thujohn/rss to composer.json.
"thujohn/rss": "~1.0"
Run composer update to pull down the latest version of RSS.
Now open up app/config/app.php and add the service provider to your providers array.
'providers' => array(
'Thujohn\Rss\RssServiceProvider',
)
Now add the alias.
'aliases' => array(
'Rss' => 'Thujohn\Rss\RssFacade',
)
Returns the feed
Route::get('/', function()
{
$feed = Rss::feed('2.0', 'UTF-8');
$feed->channel(array('title' => 'Channel\'s title', 'description' => 'Channel\'s description', 'link' => 'http://www.test.com/'));
for ($i=1; $i<=5; $i++){
$feed->item(array('title' => 'Item '.$i, 'description|cdata' => 'Description '.$i, 'link' => 'http://www.test.com/article-'.$i));
}
return Response::make($feed, 200, array('Content-Type' => 'text/xml'));
});
Save the feed
Route::get('/', function()
{
$feed = Rss::feed('2.0', 'UTF-8');
$feed->channel(array('title' => 'Channel\'s title', 'description' => 'Channel\'s description', 'link' => 'http://www.test.com/'));
for ($i=1; $i<=5; $i++){
$feed->item(array('title' => 'Item '.$i, 'description|cdata' => 'Description '.$i, 'link' => 'http://www.test.com/article-'.$i));
}
$feed->save('test.xml');
});