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
.
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 DigitalOcean, Linode or any other cloud platform
spatie/laravel-feed
PackageRun 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",
}
web.php
Thanks to the Spatie team this comes all built in. Its as simple as the following command
/** In web.php */
Route::feeds();
feed.php
config fileOnce 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