Add feeds (json, rss, atom) to Eloquent models

v1.0 2013-09-22 16:42 UTC


Add RSS, Atom and JSON feeds to Eloquent models Still being developed for ScubaClick, so handle with care for now!

Stable Version



Install by adding the following to the require block in composer.json:

"scubaclick/feeder": "dev-master"

Then run composer update.

Laravel-specific Installation

Then add the following in app/config/app.php to the service providers array:


Then add to the aliases array the following:

'Feeder' => 'ScubaClick\Feeder\Facades\LaravelFacade',

To change the configuration values, run the following command in the console:

php artisan config:publish scubaclick/feeder

Producing Feeds

To actually be able to produce any feeds, your models must implement ScubaClick\Feeder\Contracts\FeedInterface. It consists of only one method, getFeedItem($format), which should return the following array:

    'title'       => $title,
    'author'      => $author,
    'link'        => $link,
    'pubDate'     => $pubdate,
    'description' => $description,


You can use the feeder class like so, e.g. in a controller:

$items = Post::orderBy('created_at', 'desc')

return Feeder::setChannel([
	    'title'       => 'Feed title',
	    'description' => 'Feed description',


Thanks to laravel4-feed for the feed templates.


ScubaClick Feeder is licenced under the MIT license.