Generate a JSON Feed with Laravel

JSON Feed is a new standard to formalize a JSON based RSS feed that aims to simplify creating feeds by doing away with the XML standard. Implementing a feed for your site is simple, and the spec is surprisingly clear.

One thing to notice is that with Laravel we do not have to set any special headers or really anything. Just return the $data array, and it’ll automatically be converted to JSON and have the proper headers.

If you’d like to implement a package for this or need a more advanced setup check out the brand new LaravelJsonFeed package by Mateus Guimarães.