Hi friends this is sequel of my another article How To Generate Sitemap in PHP Laravel. As I had discussed that for every website SEO plays key and vital role for Google Page ranking.

If your working on Wordpress, Drupal, October CMS, Joomla or any other CMS then generating RSS is on tip of your fingers. But it will be bit confusing or difficult to generate in PHP Laravel. In this article I will show you how easily you can generate RSS feed in PHP Laravel.


Prerequisites

Hope you guys have a Blog or CMS developed in Laravel where you want to implement this RSS feed. And if your looking to host and play for free credits then you can setup your server with DigitalOceanLinode or any other cloud platform


Step 1 - Installing Laravel spatie/laravel-feedPackage

Run the following composer command to install the spaite/larvel-feed package.

composer require spatie/laravel-feed

This will be installed in your vendor folder and added in require key of composer.json which will be as follows

"require": {
	"spatie/laravel-feed": "^2.6",
}

Step 2 - Add Feed Routes in web.php

Thanks to the Spatie team this comes all built in. Its as simple as the following command

/** In web.php */

Route::feeds();

Step 3 - Publish feed.php config file

Once you run the following command it will generate feed.php in config/feed.php where you can do few customisation, which I will explain later.

php artisan vendor:publish --provider="Spatie\Feed\FeedServiceProvider" --tag="con

#laravel #rss #php

How To Generate RSS Feeds in PHP Laravel
17.25 GEEK