Every two weeks I send out a newsletter containing lots of interesting stuff for the modern PHP developer. You can expect quick tips, links to interesting tutorials, opinions and packages. Want to learn the cool stuff? Then sign up now!

A package to easily generate feeds in Laravel

Yesterday our newest package laravel-feed was released. It makes generating¬†RSS feeds in Laravel very easy. It’s very opinionated to fit the needs of our projects, but I believe lots of other developers will find it useful too. There’s almost no coding involved to create some feeds.

Installation encompasses:

  • registering the service provider (you’ve probably done this a gazillion times by now)
  • publishing a config file
  • calling a route macro in your routes file to register the view routes
  • adding a partial in the head section of your template to display links to the feeds

After you’ve done that adding feeds to your site is a breeze. You’ll only need to add some values to the configuration file. Here’s an example:

return [

    'feeds' => [

             * Here you can specify which class and method will return
             * the items that should appear in the feed. 

            'items' => '\App\[email protected]',
             * The feed will be available on this url.
            'url' => '/feed',


After that you’re done. The package will convert all models that are returned by the getAll()-function of the \App\Model-class to feed items. The feed items will be displayed on the /feed url. On all pages a link to that feed will appear in the head section.

Want to know more about the package? Then head over to GitHub to read the readme and view some code. If you like it, maybe one of our other Laravel packages can be of some use to you as well.

Freek Van der Herten is a partner and developer at Spatie, an Antwerp based company that specializes in creating web apps with Laravel. After hours he writes about modern PHP and Laravel on this blog. When not coding he’s probably rehearsing with his kraut rock band.
  • Xavi A.

    Hey, i have this error:

    This page contains the following errors:

    error on line 5 at column 71: Entity ‘oacute’ not defined

    Below is a rendering of the page up to the first error.

    Any suggestion?


    • Unfortunately I don’t see the rendering. Please open up an issue on GitHub and we’ll take it from there.